Apsl Ads Flutter Kids

Please show some ❤️ to the package, give it a 👍, and ⭐️ the repo to support the project!

Simplify the integration of ads from various ad networks into your Flutter app effortlessly.


  • Google Mobile Ads (banner, appOpen, interstitial, rewarded ad, native ad)

Admob Mediation

  • This plugin offers support for AdMob mediation. See Details for the AdMob Mediation Guide.
  • Simply add the native platform settings for AdMob mediation.

Platform Specific Setup


Update your Info.plist

  • The key for Google Ads are required in Info.plist.

Update your app's ios/Runner/Info.plist file to add two keys:

  • You have to add SKAdNetworkItems for all networks provided by Apsl-ads-flutter info.plist you can copy paste SKAdNetworkItems in your own project.


Update AndroidManifest.xml

        <!-- Sample AdMob App ID: ca-app-pub-3940256099942544~3347511713 -->

Initialize Ad Ids

import 'dart:io';

import 'ads_id_manager.dart';

class TestAdsIdManager extends AdsIdManager {
  const TestAdsIdManager();

  List<AppAdIds> get appAdIds => [
          adNetwork: 'admob',
          appId: Platform.isAndroid
              ? 'ca-app-pub-3940256099942544~3347511713'
              : 'ca-app-pub-3940256099942544~1458002511',
          appOpenId: Platform.isAndroid
              ? 'ca-app-pub-3940256099942544/3419835294'
              : 'ca-app-pub-3940256099942544/5662855259',
          bannerId: Platform.isAndroid
              ? 'ca-app-pub-3940256099942544/6300978111'
              : 'ca-app-pub-3940256099942544/2934735716',
          interstitialId: Platform.isAndroid
              ? 'ca-app-pub-3940256099942544/1033173712'
              : 'ca-app-pub-3940256099942544/4411468910',
          rewardedId: Platform.isAndroid
              ? 'ca-app-pub-3940256099942544/5224354917'
              : 'ca-app-pub-3940256099942544/1712485313',
          nativeId: Platform.isAndroid
              ? 'ca-app-pub-3940256099942544/2247696110'
              : 'ca-app-pub-3940256099942544/3986624511',

Initialize the SDK

Before loading ads, have your app initialize the Mobile Ads SDK by calling ApslAds.instance.initialize() which initializes the SDK and returns a Future that finishes once initialization is complete (or after a 30-second timeout). This needs to be done only once, ideally right before running the app.

Before you start showing ads in your app, make sure to initialize the Mobile Ads SDK by calling ApslAds.instance.initialize(). This will initialize the SDK and return a Future that completes when the initialization is done (or after a 30-second timeout). You only need to do this once, preferably right before running your app.

import 'package:apsl_ads_flutter/apsl_ads_flutter.dart';
import 'package:flutter/material.dart';

const IAdIdManager adIdManager = TestAdIdManager();

    adMobAdRequest: const AdRequest(),
    admobConfiguration: RequestConfiguration(testDeviceIds: []),

Interstitial/Rewarded Ads

Load an ad

Ad is automatically loaded after being displayed or first time when you call initialize. As a safety measure, you can call this method to load both rewarded and interstitial ads. If an ad is already loaded, it won't load again.


Show interstitial or rewarded ad


Show appOpen ad


Show Banner Ads

This is how you may show banner ad in widget-tree somewhere:

Widget build(BuildContext context) {
    crossAxisAlignment: CrossAxisAlignment.stretch,
    children: [
      const Spacer(),
          adNetwork: AdNetwork.admob, adSize: AdSize.mediumRectangle),

Show All Banner Ad one by one

Banners will attempt to load ad networks in the order you provided. If a network fails to load for any reason, it will automatically move on to the next one to prevent revenue loss.

To set the order for All Banner, simply pass the orderOfAdNetworks parameter in the ApslAllBannerAd constructor like this:

Other wise it will set by default as admob, facebook, unity and default AdSize is AdSize.banner,

This is how you may show banner ad in widget-tree somewhere:

Widget build(BuildContext context) {
  return Scaffold(
    appBar: AppBar(
      title: Text('My App'),
    body: Column(
      children: [
        // Your other widgets...
          orderOfAdNetworks: [
          adSize: AdSize.largeBanner,
          // Other parameters...
        // Your other widgets...

Listening to the callbacks

Declare this object in the class

  StreamSubscription? _streamSubscription;

The following code snippet demonstrates the process of displaying an interstitial ad and checking if it has been shown: If true, we are canceling the subscribed callbacks, if any. Then, we are listening to the Stream and accessing the particular event we need

if (ApslAds.instance.showInterstitialAd()) {
  // Canceling the last callback subscribed
  // Listening to the callback from showInterstitialAd()
  _streamSubscription =
  ApslAds.instance.onEvent.listen((event) {
    if (event.adUnitType == AdUnitType.interstitial &&
        event.type == AdEventType.adDismissed) {