Cordova Plugin Admob Android | IOS
ISC License
Bot releases are visible (Hide)
Published by EMI-INDO 11 months ago
cordova plugin rm emi-indo-cordova-plugin-admob
cordova plugin add [email protected] --variable APP_ID_ANDROID=ca-app-pub-39402xxxxxxxx~xxxxxxxxxx
cordova.plugins.emiAdmobPlugin.hideBannerAd();
hideBannerAd();
can be re-displayed, without having to reload, while removeBannerAd();
must be reloaded to display it again.For example globalSettings
cordova.plugins.emiAdmobPlugin.globalSettings(
setAppMuted = false, // Type Boolean default: false
setAppVolume = 1, // Type float default: 1
enableSameAppKey = false, // Type Boolean default: false
npa = "1", // string "0" | "1"
enableCollapsible = true, // (BETA) activate the collapsible banner ads
responseInfo = true, // For debugging and logging purposes
// Optional
(info) => {
// event.value += (info)
},
(error) => {
});
For example Banner Ads
// index.html https://github.com/EMI-INDO/emi-indo-cordova-plugin-admob/blob/main/example/banner_ads.html
let loadBannerAd = () => {
cordova.plugins.emiAdmobPlugin.loadBannerAd(
adUnitId = "ca-app-pub-3940256099942544/6300978111",
position = "bottom-center",
size = "ANCHORED",
collapsible = "bottom", // "bottom" | "top" (BETA) enable in globalSettings, enableCollapsible = true
// note move variable adaptiveWidth to adaptive_Width
adaptive_Width = 320, // Ignored
autoShow = false, // boolean
(info) => {
console.log( "\n ResponseInfo: " + JSON.stringify(info)); // responseInfo = true
},
(error) => {
console.log("\n Error: " + error)
});
}
// call loadBannerAd();
For example App Open or Interstitial or Rewarded or Rewarded interstitial
// now an example of App Open Ad, autoShow = true
let loadAppOpenAd = () => {
cordova.plugins.emiAdmobPlugin.loadAppOpenAd(
adUnitId = "ca-app-pub-3940256099942544/9257395921",
autoShow = true, // boolean
// responseInfo = true, moved to globalSettings
(info) => {
console.log( "\n ResponseInfo: " + JSON.stringify(info)); // responseInfo = true
},
(error) => {
console.log("\n Error: " + error)
});
}
// call loadAppOpenAd();
Published by EMI-INDO over 1 year ago
https://developers.google.com/admob/android/rel-notes
on.sdkInitialization
on.appOpenAd.loaded
on.appOpenAd.failed.loaded
on.appOpenAd.dismissed
on.appOpenAd.failed.show
on.appOpenAd.show
on.appOpenAd.revenue // NEW
on.banner.load
on.banner.failed.load
on.banner.click
on.banner.close
on.banner.impression
on.banner.open
on.banner.revenue // NEW
on.banner.remove // NEW
on.interstitial.loaded
on.interstitial.failed.load
on.interstitial.click
on.interstitial.dismissed
on.interstitial.failed.show
on.interstitial.impression
on.interstitial.show
on.interstitial.revenue // NEW
on.rewarded.loaded
on.rewarded.failed.load
on.rewarded.click
on.rewarded.dismissed
on.rewarded.failed.show
on.rewarded.impression
on.rewarded.show
on.rewarded.revenue // NEW
on.rewarded.ad.skip // NEW
on.reward.userEarnedReward // NEW
on.rewardedInt.loaded
on.rewardedInt.failed.load
on.rewardedInt.click
on.rewardedInt.dismissed
on.rewardedInt.failed.show
on.rewardedInt.impression
on.rewardedInt.showed
on.rewardedInt.revenue // NEW
on.rewardedInt.ad.skip // NEW
on.rewardedInt.userEarnedReward // NEW
on.consent.info.update
on.consent.info.update.failed
on.consent.status.not_required
on.consent.status.obtained
on.consent.status.required
on.consent.status.unknown
on.consent.failed.show
on.consent.failed.load.from
on.consent.form.not.available
Published by EMI-INDO over 1 year ago
AdUnitId
// Load Interstitial Ad
old variable name: interstitialAdAdUnitId
interstitialAdAdUnitId
= "ca-app-pub-3940256099942544/1033173712"
new variable name: AdUnitId
AdUnitId
= "ca-app-pub-3940256099942544/1033173712"
https://developers.google.com/admob/android/global-settings
cordova.plugins.emiAdmobPlugin.globalSettings(
setAppMuted = true, // Type Boolean default: true
setAppVolume = 1.0, // Type float
enableSameAppKey = false, // Type Boolean default: false
// Optional
(info) => { alert(info) },
(error) => { alert(error)
});
cordova.plugins.emiAdmobPlugin.targeting(
TagForChildDirectedTreatment = 0, // value: 0 | -1 | 1
TagForUnderAgeOfConsent = 0, // // value: 0 | -1 | 1
MaxAdContentRating = "G", // value: G | MA | PG | T | ""
// Optional
(info) => { alert(info) },
(error) => { alert(error)
});
Bundle[{max_ad_content_rating=G,
npa=1,
is_designed_for_families=0,
under_age_of_consent=0]
https://developers.google.com/admob/android/native/start
https://developers.google.com/admob/android/impression-level-ad-revenue
https://developers.google.com/admob/android/ssv
Published by EMI-INDO over 1 year ago
Published by EMI-INDO over 1 year ago
let _targeting = () => {
cordova.plugins.emiAdmobPlugin.targeting(
TagForChildDirectedTreatment = false, // boolean
TagForUnderAgeOfConsent = false, // boolean
MaxAdContentRating = "MA" // string | G | PG | T | MA
);
}
// call _targeting();
Published by EMI-INDO over 1 year ago
responseInfo = true, // boolean (debugging)
https://github.com/EMI-INDO/emi-indo-cordova-plugin-admob/blob/main/example/index.html
emi-indo-cordova-plugin-consent
https://github.com/EMI-INDO/emi-indo-cordova-plugin-consent
https://github.com/EMI-INDO/emi-indo-cordova-plugin-admob/discussions/categories/fund-features
Published by EMI-INDO over 1 year ago
cordova.plugins.emiAdmobPlugin.initialize(function(getVersion){},
function getVersion(SDK) { alert("SDK Version: " + SDK) }
);
Example code
https://github.com/EMI-INDO/emi-indo-cordova-plugin-admob/blob/main/example/getMediationAdapterName.html
Published by EMI-INDO over 1 year ago
( Stable release 0.0.3)
Add mediation initialization Adapter Statusr,
get Mediation Adapter Class Name,
Rename events or AdUnitId,
Update https://github.com/EMI-INDO/emi-indo-cordova-plugin-admob/blob/main/example/index.html
( bug fix )
banner, Interstitial, Rewarded, Rewarded interstitial.
Published by EMI-INDO over 1 year ago
Banner Ads
Interstitial Ads
Rewarded Ads
Rewarded interstitial Ads