私は現在これを使用しています。シミュレーターでも機能します。エラーが発生しましたが、エラーではありません。広範囲に検索したところ、より有益なメッセージであることがわかりました。
主なポイントは、テスト モードが NO に設定されている場合に実際の広告を表示し、テスト モードが YES に設定されている場合に「成功、広告銀河を旅する準備ができました」というメッセージを取得することです。したがって、どちらかの結果がアプリに表示されていれば問題ありません。:)
私のコードは次のとおりです。
GADBannerView *bannerView_ = [[GADBannerView alloc] initWithAdSize:kGADAdSizeBanner];
bannerView_.adUnitID = GOOGLE_UNIT_ID;
GADRequest *request = [GADRequest request];
bannerView_.delegate = self;
bannerView_.rootViewController = self;
// Make the request for a test ad. Put in an identifier for
// the simulator as well as any devices you want to receive test ads.
request.testDevices = [NSArray arrayWithObjects:
GAD_SIMULATOR_ID,
nil];
// Initiate a generic request to load it with an ad.
[bannerView_ loadRequest:request];
テストを YES に設定しませんでした。Google AdMobs SDK のバージョンは 6.5.1 です
本番環境でヘルプが必要だとおっしゃっていたので、とにかくテスト モードに設定するべきではありません。そのため、おそらくテスト モードなしで実行する必要があります。
シミュレーターで実行するか実機で実行するかは問題ではないという質問を見ると、両方のデバイスで実行する必要があります。コードでデリゲートを self に設定したため、同じことを行う場合は、次のメソッドを使用できます。
- (void) adView: (GADBannerView*) view didFailToReceiveAdWithError: (GADRequestError*) error
- (void) adViewDidReceiveAd: (GADBannerView*) view
これらは、シミュレーターで実行している場合でも、広告をまったく受け取ったかどうかを確認するのに役立ちます.
お役に立てれば!:)