crosspromote_admob 0.2.0
crosspromote_admob: ^0.2.0 copied to clipboard
A package to display CrossPromote ads in Flutter with AdMob as a fallback.
CrossPromote (+ Google AdMob) - Flutter #
crosspromote_admob is a package that allows you to display custom ads, referrals, and sponsored content inside your app, and to manage it through a unified dashboard.
It also supports Google AdMob as a fallback when there are no matching CrossPromote ads, or when the response is a metadata ad.
Getting started #
-
Create an account on CrossPromote.
-
Create your first ad, assign it to a an ad set, and create a new app.
-
Copy your app's identifier (it's visible under your app's name in the dashboard).
-
Add this package to your dependencies.
dependencies:
crosspromote_admob: latest_version
- Get the dependencies.
flutter pub get
-
Configure AdMob, and get your iOS and Android Unit IDs. You can follow this tutorial, if you need help.
-
Use
BannerAdwidget in your app.
BannerAd(
appId: 'replace-with-your-crosspromote-app-id',
size: AdSize.w320h100,
configuration: AdMobConfiguration(
iosId: 'ios-admob-unit-id',
androidId: 'android-admob-unit-id',
// By default in debug mode we use dedicated test IDs. To override this behavior uncomment the line below.
// liveMode: true,
),
)
Additional information #
- This package exports
crosspromote_flutter, so if you want to use somewhere CrossPromote without a fallback, there is an option to do so. - You can warm up AdMob SDK by calling
CrossPromoteAdMob.warmUp(). - You can use predefined identifiers to test your app during development, and avoid incurring cost during testing. Use
example.image.w320h50as your app id to display an ad that is 320x50,example.image.w468h60for 468x60, etc. - To maintain consitency with the AdMob package,
sizeparameter is required. - To avoid layout shift, you can pass both
AdSize, andAdSizeMatch.exactasmatchparameter. - This package requires at least Flutter 3.32.0 to work.
- If there are any issues feel free to go to GitHub Issues and report a bug.