【问题标题】:The admod can't show in real deviceadmod 无法在真实设备中显示
【发布时间】:2019-03-15 13:58:29
【问题描述】:

我在我的应用程序中使用firebase_admob 0.8.0+3 显示 admob,它在测试模式下工作,但是当我部署到我的真实设备时,它不起作用,在 android 设备上显示广告,我只是在控制台中出现以下错误:

W/flutter (11675): onAdFailedToLoad: 3
I/Ads     (11675): Ad failed to load : 3
I/flutter (11675): BannerAd event is MobileAdEvent.failedToLoad

但是当我尝试添加 testDevices 时,它可以显示带有Test Ad 标签的广告

在 iOS 中的另一种方式,它可以在我的 iPhone 8+ 中显示广告,但无法在其他 iOS 设备中显示,我只是怀疑为什么以及如何修复它?

请查看以下代码:

FirebaseAdMob.instance.initialize(appId: appId);
    MobileAdTargetingInfo targetingInfo = MobileAdTargetingInfo(
        keywords: <String>['flutterio', 'beautiful apps'],
        contentUrl: 'https://flutter.io',
        birthday: DateTime.now(),
        childDirected: false
        // testDevices: <String>[
        //   'FBBACD1EFD1C957AEF3087B3C9074B8F'
        // ], // Android emulators are considered test devices
        );

    myBanner = BannerAd(
      // Replace the testAdUnitId with an ad unit id from the AdMob dash.
      // https://developers.google.com/admob/android/test-ads
      // https://developers.google.com/admob/ios/test-ads
      adUnitId: appUnitId,
      size: AdSize.smartBanner,
      targetingInfo: targetingInfo,
      listener: (MobileAdEvent event) {
        print("BannerAd event is $event");
      },
    );

我是否需要发布到 google play 才能正常运行?!

【问题讨论】:

    标签: flutter admob


    【解决方案1】:

    好的,仅供参考,当我将应用发布到应用商店和google play store时,广告功能正在工作,所以确实需要为admod发布应用!

    【讨论】:

      【解决方案2】:

      如果您刚刚在 admob 中创建了 adUnit Id,则可能会发生该错误。因此,您需要等待一段时间(最多一天)才能获得填充物。

      【讨论】:

      • 其实我已经等了几天了:(
      • 用 VPN 试试吧。有时,广告需要花费一些时间才能传播到所有国家。还要检查屏蔽控件,看看您是否屏蔽了广告。
      • 我也怀疑是网络问题,但是我尝试使用不同的网络也失败了,如果是网络问题,为什么在我的iphone上可以正常工作?
      • 广告网络可能需要一段时间才能传播到所有设备和国家/地区。因此,如果您选择 VPN 或使用其他设备,您可能会收到广告。
      • 我尝试在几个国家/地区使用VPN但仍然无法正常工作,只是显示相同的错误,但我的iOS设备还可以,这很奇怪!
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-01-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多