samedi 7 février 2015

Ad Banner works on iOS simulator but never on device


I implemented iAd/AdMob mediation for iOS app. Mediation works well in simulator that iAd test banner shows up first and when it fails, AdMob test banner shows up. However, on actual device the iAd almost never fails and when it does fail, AdMob never shows up. So I don't understand how my code can work perfectly for simulator but not on device? I don't know if it's my code or something else. When something works perfectly on simulator but not on device, what can the issue be?


My code:



- (void)viewDidLoad
{

[super viewDidLoad];



self.adView = [[ADBannerView alloc] initWithFrame:CGRectMake(0, 60, 320, 50)];
self.adView.delegate = self;

[self.view addSubview:adView];
}



-(void)bannerView:(ADBannerView *)banner didFailToReceiveAdWithError:(NSError *)error{

self.adView.hidden=YES;

NSLog(@"Google Mobile Ads SDK version: %@7.0.0", [GADRequest sdkVersion]);

self.adBanner_=[[GADBannerView alloc]initWithFrame:CGRectMake(0, 0, 320, 50)];

self.adBanner_.adUnitID = @"my-ID";

self.adBanner_.rootViewController=self;

[self.view addSubview:self.adBanner_];

GADRequest *request =[GADRequest request];

request.testDevices = @[ @"2077ef9a63d2b398840261c8221a0c9b"];

[self.adBanner_ loadRequest:request];

}


I asked this question on Stackoverflow and people view it but never answer. I'm really stuck because I need help and I don't know what's wrong or what it can be. I've never had an issue like this before where something worked on simulator but not on device.





Aucun commentaire:

Enregistrer un commentaire