首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在应用内购买的帮助下删除广告?

如何在应用内购买的帮助下删除广告?
EN

Stack Overflow用户
提问于 2020-03-09 11:58:00
回答 1查看 1.6K关注 0票数 4

我想禁用广告后,用户购买的包,以删除帮助在应用程序内的广告。我想删除中间广告和奖励广告,下面是国际广告和奖励广告的代码:

代码语言:javascript
复制
  InterstitialAd myInterstitial = InterstitialAd(
    adUnitId: Platform.isIOS ? ios_ads : android_ads,
    listener: (MobileAdEvent event) {
      print("InterstitialAd event is $event");
    },
  );

  myInterstitial
    ..load()

    ..show(
      anchorType: AnchorType.bottom,
      anchorOffset: 0.0,

    );

奖励Ad

代码语言:javascript
复制
 RewardedVideoAd.instance.listener =
      (RewardedVideoAdEvent event, {String rewardType, int rewardAmount}) {
    if (event == RewardedVideoAdEvent.rewarded) {

    }
  };
  RewardedVideoAd.instance.load(adUnitId: Platform.isIOS ? ios_ads : android_ads, 
  targetingInfo: targetingInfo).then((v){

    print("log "+v.toString());
    if(v){
      RewardedVideoAd.instance.show();

    }

  });
EN

回答 1

Stack Overflow用户

发布于 2020-09-04 13:12:48

有一个布尔值来跟踪支付是否是为了删除广告。如果此布尔值设置为true,则不要调用ads代码。

代码语言:javascript
复制
if(!isPaymentDone){
  // code to show ads
}
票数 -2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/60600118

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档