2

I have implemented google admob sdk 6.12, ads were appearing , everything was working perfectly, after few days google updated sdk 7, again i imported new sdk but this time i am unable to use #import "GADInterstitial.h" each time i get error #import "GADInterstitial.h" not found, imported all frameworks but no success and no ads are appearing if i use @class GADInterstitial.h; and use this code

- (void)viewDidLoad {
          [super viewDidLoad];
          self.interstitial = [[GADInterstitial alloc] init];
          self.interstitial.adUnitID = Interstical_Unit_id;

          GADRequest *request = [GADRequest request];
          // Requests test ads on simulators.
          request.testDevices = @[ GAD_SIMULATOR_ID ];
          [self.interstitial loadRequest:request];
        }
 - (void)gameOver {
      if ([self.interstitial isReady]) {
        [self.interstitial presentFromRootViewController:self];
      }
      // Rest of game over logic goes here.
    }
1

3 Answers 3

5

You don't need to import headers anymore, just use this and go

@import GoogleMobileAds

Also you don't need to link other frameworks or add the -ObjC to your linker flags.

2

I was having this issue myself after upgrading. Use this instead:

#import <GoogleMobileAds/GADInterstitial.h>
2

If you add GoogleMobileAdsSdkiOS-7.0.0 folder in your app, you have to replace your #import row with the following:

#import <GoogleMobileAds/GADBannerView.h>

I had the same issue.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.