Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to show GADInterstitial in ios project?
    primarykey
    data
    text
    <h2>How to show GADInterstitial in ios project? i am getting error "Request error : no ads to show" but admob is working in my another project.</h2> <pre><code>// ViewController.h #import &lt;UIKit/UIKit.h&gt; #import "GADBannerView.h" #import "GADCustomEventBanner.h" #import "GADInterstitial.h" @interface ViewController : UIViewController &lt;GADInterstitialDelegate&gt; { UIButton *interstitialButton_; GADInterstitial *interstitial_; } @property(nonatomic, retain) IBOutlet UIButton *interstitialButton; @property(nonatomic, retain) GADInterstitial *interstitial_; - (IBAction)showInterstitial:(id)sender; @end //ViewController.h #import "ViewController.h" @implementation ViewController @synthesize interstitialButton ; @synthesize interstitial_; - (void)dealloc { interstitial_.delegate = nil; [interstitial_ release]; [interstitialButton_ release]; [super dealloc]; } - (void)interstitial:(GADInterstitial *)interstitial didFailToReceiveAdWithError:(GADRequestError *)error { // Alert the error. UIAlertView *alert = [[[UIAlertView alloc] initWithTitle:@"GADRequestError" message:[error localizedDescription] delegate:nil cancelButtonTitle:@"Drat" otherButtonTitles:nil] autorelease]; [alert show]; interstitialButton_.enabled = YES; } -(void)interstitialWillPresentScreen:(GADInterstitial *)ad{ NSLog(@"on screen"); } - (void)interstitialDidReceiveAd:(GADInterstitial *)interstitial { [interstitial presentFromRootViewController:self]; interstitialButton_.enabled = YES; [self showInterstitial:nil]; } - (IBAction)showInterstitial:(id)sender { self.interstitial_ = [[[GADInterstitial alloc] init] autorelease]; self.interstitial_.delegate = self; self.interstitial_.adUnitID = MY_ADMOB_KEY; // this key is working in admob // GADRequest *request = [GADRequest request]; request.testing = YES; [self.interstitial_ loadRequest: request]; interstitialButton_.enabled = NO; } @end </code></pre> <p><img src="https://i.stack.imgur.com/ECy7u.png" alt="enter image description here"></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload