2013-02-28 51 views
2

进入前景时,使用了iOS示例项目2.5显示AdMob插页:http://google-mobile-dev.googlecode.com/files/InterstitialExample_iOS_2.5.zip无法从背景

MainController.m,我为了在showInterstitial这样,每次调用时,应用程序从后台进入前台添加的两种方法,例如

- (void) viewDidLoad { 
     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(appWillEnterForegroundNotification) name:UIApplicationWillEnterForegroundNotification object:nil]; 
} 

- (void) appWillEnterForegroundNotification{   
    [self showInterstitial:nil]; 
} 

第一种方法是用于登记回调为视图控制器,用以接收进入前景通知,并且所述第二方法调用showInterstitial方法时发生的。我可以看到方法showInterstitial确实被调用并且请求真的被触发,但是没有成功或错误的回调被调用。

有什么想法?

回答

4

这可能不是显示插页式广告的正确时间。您希望应用程序再次处于活动状态,而不是要处于活动状态。

尝试从- (void)applicationDidBecomeActive:(UIApplication *)application

+1

你救了我的一天,我想吻你<3 – Ryan 2013-03-01 11:40:16