Admob configuration

To get your Admob works in this apps you must add your own Admob banner,Interstitial & video ID'S to the admob-service file for both IOS and ANDROID.
You can create your own Admob ads account from Google Admob.
After you create your Admob account, open config.xml file and add your own Admob ID
<plugin name="cordova-plugin-admob-free" spec="^0.21.0">
<variable name="ADMOB_APP_ID" value="YOUR ADMOB ID" />
</plugin>

Then navigate to src/providers/admob/admob.ts. and past your Admob information for both Android and IOS.
if(this.platform.is('android')) {
this.bannerId = '';//<-- Past your banner admob id for android here
this.InterstitialId = '';//<-- Past your Interstitial admob id for android here
this.VideoID = "";//<-- Past your video admob id for android here
}
if(this.platform.is('ios')) {
this.bannerId = "";//<-- Past your banner admob id for ios here
this.InterstitialId = "";//<-- Past your Interstitial admob id for ios here
this.VideoID = "";//<-- Past your video admob id for ios here
}

If you want to use Admob in testing mode you can set the value of isTesting to true.
public bannerConfig: AdMobFreeBannerConfig = {
id:this.bannerId,
autoShow: true,
isTesting:false,//<- if you want just to test if admob is working , you can set the value to true
};
public InterstitialConfig : AdMobFreeInterstitialConfig = {
id:this.InterstitialId,
autoShow:true,
isTesting:false,//<- if you want just to test if admob is working , you can set the value to true
}
public RewardVideoConfig : AdMobFreeRewardVideoConfig = {
id:this.VideoID,
autoShow : true,
isTesting:false,//<- if you want just to test if admob is working , you can set the value to true
}

Last updated
Was this helpful?