ads_comman 0.0.6 copy "ads_comman: ^0.0.6" to clipboard
ads_comman: ^0.0.6 copied to clipboard

A flutter plugin for google ads in android.

ads_comman #

ads_comman is flutter package for add google advertise to you ap

Installation #

run this command to your flutter project terminal

flutter pub add ads_comman

Usage #

Initilize Ads #

final _adsCommanPlugin = AdsComman();
 @override
  void initState() {
    super.initState();
       // Initilize to Advertisment in you project
       await _adsCommanPlugin
          .changeAdvertisementId(
        advertisementId: "YOUR_GOOGLE_ADS_APPLICATIONID", // you google Ad mobe Application id
        testDeviceIds: [""], // your device test id
        interstitialAdsTime: 40, // give time in second for display an Interstitial ad after 10 seconds of any event
        appOpenTimer: 40,//give time in second for display app open ad after 10 seconds of any event
      )
          .then((value) {
        _adsCommanPlugin.loadInterstitialAd(
            interstitialID: "INTERSTITAL_ADS_ID");  //Load Interstitial for first time
      });
  }

Display Banner Ad #

  _adsCommanPlugin.getBannerAds(
    context: context,
    bannerAdID: "BANNER ADS_ID",
    onBannerAdLoaded: () {
         // TODO: after banner Loaded
      }
    },
  ),

Display Interstitial Ad #

ElevatedButton(
  onPressed: () {
    _adsCommanPlugin.showInterstitialAd(
        interstitialID: "INTERSTITAL_ADS_ID"); // it will display full screen Video Ad
  },
  child: const Text("Show Interstitial Ad"),
),

Display Interstitial Ad after delay which is given in init #

ElevatedButton(
  onPressed: () {
    _adsCommanPlugin.getDelayedInterAd(
        interstitialID: "INTERSTITAL_ADS_ID); //It will show ads after dilay
  },
  child: const Text("Show Interstitial Ad After Some Time"),
),

Display App open Ads #

// Add this line when app is Start it will show app open ad after 40 seconds user can change this time at Initilize time 
_adsCommanPlugin.initAppOpenAd(
    appOpenAdsId: "APPOPEN_ADS_ID");

License #

MIT

5
likes
90
pub points
53%
popularity

Publisher

unverified uploader

A flutter plugin for google ads in android.

Repository (GitHub)
View/report issues

Documentation

API reference

License

unknown (LICENSE)

Dependencies

flutter, get_storage, google_mobile_ads, plugin_platform_interface

More

Packages that depend on ads_comman