0
在我的cocos2d-x項目中,我已經完成了以下代碼,用於在設備/模擬器上展示廣告。在模擬器或設備上不顯示Ad-mob廣告
GADInterstitial *gAdInterstitial; = [[GADInterstitial alloc] init];
gAdInterstitial.adUnitID = @gAdUnitID;
NSLog(@"Add Unit Id %@",gAdInterstitial.adUnitID);
//AdMob
GADRequest *request = [GADRequest request];
// request.testDevices = [NSArray arrayWithObjects:GAD_SIMULATOR_ID, nil];
// request.testDevices = [NSArray arrayWithObjects:GAD_SIMULATOR_ID,@"122189cf8ed3c83551f5df0585f4694f410f5041", @"eb26e6181da2a2da39f3410cd29c4c2c26ac19a6", nil];
request.testing = YES;
request.testDevices = @[GAD_SIMULATOR_ID];
[gAdInterstitial loadRequest:request];
gAdInterstitial.delegate = self;
此代碼已在rootviewcontroller類和iOS的appcontroller類中完成。問題在於即使在網絡上也沒有顯示任何廣告。
嘗試在loadRequest之前設置'gAdInterstitial'的委託: – tipycalFlow