bdlukaa / native_admob_flutter

Easy-to-make native ads in flutter using AdMOB SDK.
https://pub.dev/packages/native_admob_flutter
BSD 3-Clause "New" or "Revised" License
80 stars 56 forks source link

Using Interstitial ad with AppOpen ad #127

Closed nathan1658 closed 2 years ago

nathan1658 commented 2 years ago

Currently Im using native_admob_flutter to my flutter app. I also included AppOpen Ad and Interstital ad.

I want to display the AppOpen ad when user open the app/ resume to the app, here is how I do it in main.dart:

Future<void> didChangeAppLifecycleState(AppLifecycleState state) async {     
switch (state) {
  case AppLifecycleState.resumed:
    loadAndDisplayAppOpenAd();
    break;
  case AppLifecycleState.inactive:
    break;
  case AppLifecycleState.paused:
    break;
  case AppLifecycleState.detached:
    break;
}
}

However I found that displaying Interstial ad will also change the app state -> inactive -> paused -> resume, which trigger AppOpen ad.

Is there a way to overcome this?

bdlukaa commented 2 years ago

Maybe https://pub.dev/packages/flutter_fgbg

nathan1658 commented 2 years ago

Maybe https://pub.dev/packages/flutter_fgbg

Thanks for the quick response, tested on both ios and android and works like a charm!!