firebase_admob ios和android appid,adUnitId

时间:2019-09-16 08:29:29

标签: flutter

am试图在ios和android上使用带有抖动的firebase_admob广告

我看到了 Flutter Admob AppID use Android or iOS? 展示了如何使用两个appId,很好

但是在adUnitId与每个appID都有两个

如何对每个ios或android这样的appid使用两个adUnitId

该代码

BannerAd myBanner = BannerAd(
  adUnitId: BannerAd.testAdUnitId,
  size: AdSize.smartBanner,
  targetingInfo: targetingInfo,
  listener: (MobileAdEvent event) {
    print("BannerAd event is $event");
  },
);

1 个答案:

答案 0 :(得分:0)

似乎仍然可以搜索

InterstitialAd myInterstitial = InterstitialAd(
  adUnitId: Platform.isAndroid
      ? InterstitialAd.testAdUnitId
      : InterstitialAd.testAdUnitId,
  targetingInfo: targetingInfo,
  listener: (MobileAdEvent event) {
    print("InterstitialAd event is $event");
  },
);