我用這個代碼加間質性:插頁式廣告不會出現。
- (void)applicationDidBecomeActive:(UIApplication *)application
{
GADRequest *request = [GADRequest request];
request.testDevices = [NSArray arrayWithObjects:
GAD_SIMULATOR_ID,
nil];
gadinter = [[GADInterstitial alloc] init];
gadinter.delegate = self;
gadinter.adUnitID = @"ca-app-pub-8360827428091030/4165686904";
[gadinter loadRequest:request];
}
- (void)interstitialDidReceiveAd:(GADInterstitial *)interstitial {
[gadinter presentFromRootViewController:self.window.rootViewController];
}
,我得到這個:
2015-02-09 18:57:12.636 iStrobe[5951:1824030] <Google> Cannot present interstitial. It is not ready. 2015-02-09 18:57:13.801 iStrobe[5951:1824030] <Google> No UIViewController supplied to the ad. Cannot continue.
任何IDEEA爲什麼?在其他應用程序的作品。
你是什麼rootViewControlelr?它是'UINavigationController'還是'UITabBarController'或'UIViewController'? – 2015-02-09 18:23:07
UIVIewController – 2015-02-09 18:23:53
您可以在'[gadinter presentFromRootViewController:self.window.rootViewController]'前面添加一個'NSLog(%「%@」,self.window.rootViewController)'並查看該值是什麼?它可能是'無'? – 2015-02-09 18:33:55