Ads

Set Unit ID

You can change unit id from lib/data/my_strings.dart

class MyStrings {
. . .
// DATA FOR ADMOB
static const String publisher_id = "pub-3397136890800435";
static const String privacy_policy_url = "http://dream-space.web.id/";

// Change with your Admob data and unit id
static const ANDROID_APP_ID = "ca-app-pub-3940256099942544~1612717500";
static const ANDROID_AD_UNIT_BANNER = "ca-app-pub-3940256099942544/6300978111";
static const ANDROID_AD_UNIT_INTERSTITIAL = "ca-app-pub-3940256099942544/1033173712";

static const IOS_APP_ID = "ca-app-pub-3940256099942544~1612717500";
static const IOS_AD_UNIT_BANNER = "ca-app-pub-3940256099942544/6300978111";
static const IOS_AD_UNIT_INTERSTITIAL = "ca-app-pub-3940256099942544/1033173712";
. . .
}    

Disable

new we make easy way to disable or enable adsense in the app, you only need to set boolean value with TRUE or FALSE

class AppConfig {


 // flag for display ads, change true and false only
  static const bool ADS_ALL_ENABLE = true;

  // flag for display ads
  static const bool ADS_MAIN_BANNER = ADS_ALL_ENABLE && true;
  static const bool ADS_MAIN_INTERSTITIAL = ADS_ALL_ENABLE && true;
  static const int DELAY_NEXT_INTERSTITIAL = 60; // in second
  static const bool ADS_PLACE_DETAILS_BANNER = ADS_ALL_ENABLE && true;
  static const bool ADS_NEWS_DETAILS_BANNER = ADS_ALL_ENABLE && true;
    
    . . .
}

Last updated

Was this helpful?