[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleNotification:) name:@"showAd" object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleNotification:) name:@"loadAd" object:nil];
self.interstitial = [self createAndLoadInterstitial];
self.interstitial = [[GADInterstitial alloc] initWithAdUnitID:@"ca-app-pub-
"];
GADRequest *request = [GADRequest request];
// Requests test ads on test devices.
request.testDevices = @[@"0000000"];
[self.interstitial loadRequest:request];
//etc
- (void)handleNotification:(NSNotification *)notification{
if ([notification.name isEqualToString:@"showAd"]) {
if (self.interstitial.isReady) {
[ self.interstitial presentFromRootViewController:self];
else {
if ([notification.name isEqualToString:@"loadAd"]) {
self.interstitial = [self createAndLoadInterstitial];