CrossPromote (+ Google AdMob) - Flutter

Package Publisher MIT License

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

  1. Create an account on CrossPromote.

  2. Create your first ad, assign it to a an ad set, and create a new app.

  3. Copy your app's identifier (it's visible under your app's name in the dashboard).

  4. Add this package to your dependencies.

dependencies:
  crosspromote_admob: latest_version
  1. Get the dependencies.
flutter pub get
  1. Configure AdMob, and get your iOS and Android Unit IDs. You can follow this tutorial, if you need help.

  2. Use BannerAd widget 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.w320h50 as your app id to display an ad that is 320x50, example.image.w468h60 for 468x60, etc.
  • To maintain consitency with the AdMob package, size parameter is required.
  • To avoid layout shift, you can pass both AdSize, and AdSizeMatch.exact as match parameter.
  • 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.

Maintainers

Libraries

crosspromote_admob