skip to Main Content

When we show Interstitial ads, App open ad is also displayed each time. it means display twice ads 1 interstitial and another one is App open. some times it going to in infinite loop, App open ads not close.

2

Answers


  1. Chosen as BEST ANSWER

    The problem is interstitial popping up is considered as native android element and it causes flutter app to change its lifecycle to inactive and after you close the native view interstitial the flutter app come back to life and it changes its lifecycle to resumed so your code calls the show app open ads immediately.

    As a work around for this ill suggest you to use this plugin : flutter_fgbg https://pub.dev/packages/flutter_fgbg

    and then you can listen to the app if its on background or foreground and show the app open ad when app on foreground

    late StreamSubscription subscription;

    @override

    void initState() {

    subscription = FGBGEvents.stream.listen((event) {

    print(event);

    if (event == FGBGType.foreground) {

    MobileAds.instance.initialize();

    load(); }

    });}
    

  2. The problem is interstitial popping up is considered as native android element and it causes flutter app to change its lifecycle to inactive and after you close the native view interstitial the flutter app come back to life and it changes its lifecycle to resumed so your code calls the show app open ads immediately.
    

    As a work around for this ill suggest you to use this plugin : flutter_fgbg https://pub.dev/packages/flutter_fgbg

    and then you can listen to the app if its on background or foreground and show the app open ad when app on foreground

    late StreamSubscription subscription;

    @override

    void initState() {

    subscription = FGBGEvents.stream.listen((event) {

    print(event);

    if (event == FGBGType.foreground) {

    MobileAds.instance.initialize();

    load(); }

    });}

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search