open_ad_flutter 1.0.0 copy "open_ad_flutter: ^1.0.0" to clipboard
open_ad_flutter: ^1.0.0 copied to clipboard

A Plugin that allows to integrate the new App Open Ads (by Google AdMob) in your Flutter Projects.

OpenAd Flutter #

A Plugin that allows to integrate the new App Open Ads (by Google AdMob) in your Flutter Projects.

More info about App Open Ads:

https://developers.google.com/admob/android/app-open-ads https://developers.google.com/admob/ios/app-open-ads

Getting Started #

Android #

  • Add the AdMob application identifier inside AndroidManifest as specified here.
  • Create a new Application class (that subclasses FlutterApplication) inside the Android project and specify it inside AndroidManifest.
  • Add this piece of code inside the onCreate method in the Application class:
override fun onCreate() {
    super.onCreate()
    OpenAdFlutterPlugin.start(this)
}
  • If Flutter complains about <queries> at build time, change the gradle version in android/build.gradle to 3.3.3

iOS #

  • Add the AdMob application identifier inside Info.plist as specified here.

Dart #

  • Inside main.dart, after runApp(...), add this piece of code:
await OpenAdFlutter.setup(
  "ca-app-pub-3940256099942544/5662855259", // Replace with your own id,
);

Optional #

On iOS, you can optionally specify showImmediately: true inside the setup, if you want to show the open ad also at app startup. On Android it won't work.

If you want to stop presenting open ads for any reasons (for example if the user has purchased the premium version of your app), you can do so by adding this code:

await OpenAdFlutter.pause();

To restart presenting open ads:

await OpenAdFlutter.pause();

Thanksgiving #

The Android part of this library is based on this repo. Thank you for creating a manager for this ad when Google didn't do it.

TODO #

  • Make showImmediately: true work on Android
5
likes
30
pub points
10%
popularity

Publisher

unverified uploader

A Plugin that allows to integrate the new App Open Ads (by Google AdMob) in your Flutter Projects.

Repository (GitHub)
View/report issues

License

MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on open_ad_flutter