AdMob - 测试对比。出版
AdMob - Testing Vs. Publishing
所以我的应用程序中有 Google 的 AdMob,我想知道在模拟器或设备上测试时用于显示测试添加的几行代码。
这是我使用的代码(如Google Dev docs/tutorials所示):
//log version of Google Ads used.
NSLog(@"Google Mobile Ads SDK Version: %@", [GADRequest sdkVersion]);
//Replace this ad unit ID with your own ad unit ID.
self.bannerview.adUnitID = @"ca-app-pub-3940256099942544/2934735716";
self.bannerviewB.rootViewController = self;
GADRequest *request = [GADRequest request];
//Requests test ads on devices you specify. Your test device ID is printed to
//the console when an ad request is made. GADBannerView automatically returns
//test ads when running on a simulator.
request.testDevices = @[@"2077ef9a63d2b398840261c8221a0c9a"];// Eric's iPod Touch
[self.bannerviewB loadRequest:request];
我的问题是,您是否将检查您是否在自己的设备上的代码留在其中?这一行:
//Requests test ads on devices you specify. Your test device ID is printed to
//the console when an ad request is made. GADBannerView automatically returns
//test ads when running on a simulator.
request.testDevices = @[@"2077ef9a63d2b398840261c8221a0c9a"];// Eric's iPod Touch
因为我最近发现,当我从App Store下载自己的应用程序时,它仍然显示测试广告,这可能是...的原因?我只是在开发我的第二个应用程序时才想到这一点。
谢谢。
My question is, do you leave the code in that checks if you're on your own device or not?
如果您在分布式应用程序中保留 request.testDevices = @[@"testID"]
,将向您的用户展示测试广告。在将应用程序提交到 App Store 之前,您需要 删除或注释掉此行。
所以我的应用程序中有 Google 的 AdMob,我想知道在模拟器或设备上测试时用于显示测试添加的几行代码。
这是我使用的代码(如Google Dev docs/tutorials所示):
//log version of Google Ads used.
NSLog(@"Google Mobile Ads SDK Version: %@", [GADRequest sdkVersion]);
//Replace this ad unit ID with your own ad unit ID.
self.bannerview.adUnitID = @"ca-app-pub-3940256099942544/2934735716";
self.bannerviewB.rootViewController = self;
GADRequest *request = [GADRequest request];
//Requests test ads on devices you specify. Your test device ID is printed to
//the console when an ad request is made. GADBannerView automatically returns
//test ads when running on a simulator.
request.testDevices = @[@"2077ef9a63d2b398840261c8221a0c9a"];// Eric's iPod Touch
[self.bannerviewB loadRequest:request];
我的问题是,您是否将检查您是否在自己的设备上的代码留在其中?这一行:
//Requests test ads on devices you specify. Your test device ID is printed to
//the console when an ad request is made. GADBannerView automatically returns
//test ads when running on a simulator.
request.testDevices = @[@"2077ef9a63d2b398840261c8221a0c9a"];// Eric's iPod Touch
因为我最近发现,当我从App Store下载自己的应用程序时,它仍然显示测试广告,这可能是...的原因?我只是在开发我的第二个应用程序时才想到这一点。
谢谢。
My question is, do you leave the code in that checks if you're on your own device or not?
如果您在分布式应用程序中保留 request.testDevices = @[@"testID"]
,将向您的用户展示测试广告。在将应用程序提交到 App Store 之前,您需要 删除或注释掉此行。