2015-08-25 2 views
0

Вопрос: (IOS)
я хочу, чтобы отобразить GADInterstitialAd в ApplicationDidBecomeActive в AppDelegate. ниже приведен код, я использую
GADInterstitialAd не представляя в AppDelegate

- (void)showInterstitial{ 
    GADRequest *request = [GADRequest request]; // here you need to crate object of GADRequest 
    request.testDevices = @[ kGADSimulatorID ]; 
    GADInterstitial* interstitialAd = [[GADInterstitial alloc]initWithAdUnitID:AdvertismentID]; 
    interstitialAd.delegate = self; 
    [interstitialAd loadRequest:request]; 
} 
- (void)interstitialDidReceiveAd:(GADInterstitial *)interstitial { 
    [interstitial presentFromRootViewController:pagerViewController]; 
} 
- (void)interstitial:(GADInterstitial *)interstitial didFailToReceiveAdWithError:(GADRequestError *)error { 
    // [[UIApplication sharedApplication] setStatusBarHidden:FALSE withAnimation:NO]; 
    NSLog(@"==%@",[error localizedDescription]); 
} 

-(void)interstitialWillPresentScreen:(GADInterstitial *)ad{ 
    // [[UIApplication sharedApplication] setStatusBarHidden:TRUE withAnimation:NO]; 
    NSLog(@"on screen"); 
} 

и я звоню [self showInterstitial] в ApplicationDidBecomeActive
я добавил <GADInterstitialDelegate> но делегат метода не называя даже я не получаю ошибки. пожалуйста помогите.

ответ

0

ОК, я получил ответ.
просто использовал сильную ссылку GADInterstitialAd в приведенном выше коде.

Смежные вопросы