APP集成tapjoy积分墙(8)
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(fullScreenAdClosed:) name:TJC_VIEW_CLOSED_NOTIFICATION object:nil];
}
return self;
}
//显示积分墙及获取积分
-(void) showOfferWall
{
[TapjoyConnect showOffersWithViewController:[[AppDelegate sharedAppDelegate] rootViewController]];
[TapjoyConnect getTapPoints];
}
//显示banner广告
-(void)showBannerAd
{
[TapjoyConnect getDisplayAdWithDelegate:self];
}
-(void)dismissBannerAd
{
[[TapjoyConnect getDisplayAdView] removeFromSuperview];
rootWindow = nil;
}
//显示全屏广告
-(void)showFullScreenAd
{
[TapjoyConnect getFullScreenAd];
}
#pragma mark Tapjoy Connect Observer Method
//连接监视函数
-(void)tjcConnectSuccess:(NSNotification*)notifyObj
{
NSLog(@"Tapjoy connect Succeeded");
}
- (void)tjcConnectFail:(NSNotification*)notifyObj
{
NSLog(@"Tapjoy connect Failed");
}
//积分墙监视函数
-(void)offerwallClosed:(NSNotification*)notifyObj
{
NSLog(@"Offerwall closed");
}
//积分
//获取监视函数
-(void)getTJPoints:(NSNotification*)notifyObj
{
NSLog(@"获取Tapjoy积分成功!");
tapPoints = [(NSNumber*)notifyObj.object intValue];
//if(tapPoints<=0)return;
UIAlertView * alView= nil;
if(tapPoints>0)
{
alView=[[[UIAlertView alloc] initWithTitle:@"Attention"
message:[NSString stringWithFormat:@"You still have %d Tapjoy points. Do you want to exchange them to coins?",tapPoints]
delegate:self
cancelButtonTitle:@"Cancel" otherButtonTitles:@"OK", nil] autorelease];
相关新闻>>
- 发表评论
-
- 最新评论 更多>>