1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Flutter admob_flutter iOS実機で、errorCode 1 が表示される

Last updated at Posted at 2020-03-04

Flutterにて、admob_flutterを使用し、バナーをiOS実機にて表示した際、このようなエラーが出力された。

Admob banner failed to load. Error code: 1

Xcodeで Bundle Identifier を、AdMob正しいものに設定することで解決。

ずっとシュミレータでテストしていたため、適当なBundle Identifierになっていたのを
正しいものに変更した。

com.example.abc → jp.quq.abc

AdmobInterstitial の方は、エラーが無く表示されたためモヤっとはするのだが解決。

コードは、wiki で紹介されている バナー(Banner Ads)用のコードをそのまま使用していた。

AdmobBanner(
  adUnitId: getBannerAdUnitId(),
  adSize: AdmobBannerSize.BANNER,
  listener: (AdmobAdEvent event, Map<String, dynamic> args) {
    switch (event) {
      case AdmobAdEvent.loaded:
        print('Admob banner loaded!');
        break;

      case AdmobAdEvent.opened:
        print('Admob banner opened!');
        break;

      case AdmobAdEvent.closed:
        print('Admob banner closed!');
        break;

      case AdmobAdEvent.failedToLoad:
        print('Admob banner failed to load. Error code: ${args['errorCode']}');
        break;
    }
  }
)
1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?