emi-indo-cordova-plugin-admob

Cordova Plugin Admob Android | IOS

ISC License

Downloads
110
Stars
12

Bot releases are hidden (Show)

emi-indo-cordova-plugin-admob - [email protected] Latest Release

Published by EMI-INDO 11 months ago

big change release.

[email protected]

Installation

  • remove

cordova plugin rm emi-indo-cordova-plugin-admob

  • add

cordova plugin add [email protected] --variable APP_ID_ANDROID=ca-app-pub-39402xxxxxxxx~xxxxxxxxxx

  • (responseInfo) and (npa) variables moved to globalSettings, New (enableCollapsible) autoShow

Moving Variable

  • npa
  • responseInfo

New Variable

Rename banner size

  • Anchored_adaptive to ANCHORED
  • Inline_adaptive to IN_LINE

New banner action

  • hideBannerAd();
    For example hideBannerAd
    cordova.plugins.emiAdmobPlugin.hideBannerAd();
    Note hideBannerAd(); can be re-displayed, without having to reload, while removeBannerAd(); must be reloaded to display it again.

NEW API

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();
emi-indo-cordova-plugin-admob - [email protected]

Published by EMI-INDO over 1 year ago

Update Mobile Ads SDK (Android: 22.2.0)

https://developers.google.com/admob/android/rel-notes

All full examples

All event names updated

  • neat short easy to read
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
emi-indo-cordova-plugin-admob - [email protected]

Published by EMI-INDO over 1 year ago

[email protected]

  • ( Plugin Version 1.0.9 ) Replace all Variables xxxxxx = "ca-app-pub-xxx" with AdUnitId

All ad unit variable names must be changed to AdUnitId

the previous example

// Load Interstitial Ad

  • old variable name: interstitialAdAdUnitId

    interstitialAdAdUnitId = "ca-app-pub-3940256099942544/1033173712"

  • new variable name: AdUnitId
    AdUnitId = "ca-app-pub-3940256099942544/1033173712"

As suggested by Google, when the SDK initializes this plugin automatically takes the Global Settings and Targeting values.

New Features ( Global Settings )

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)

    });

New Features ( Targeting )

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)

   });
  • ( Targeting ) response ad loaded
Bundle[{max_ad_content_rating=G, 
npa=1, 
is_designed_for_families=0, 
under_age_of_consent=0]

Coming soon

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

💰Sponsor this project

PayPal

emi-indo-cordova-plugin-admob - [email protected]

Published by EMI-INDO over 1 year ago

release @0.0.7 and @0.0.8

  • npa to index 1, new banner responInfo ( debug )
  • update README.md
  • update example index.html
  • new banner size ( Anchored_FULL_WIDTH | FLUID )
emi-indo-cordova-plugin-admob - [email protected]

Published by EMI-INDO over 1 year ago

New Features



let _targeting = () => {

    cordova.plugins.emiAdmobPlugin.targeting(
             TagForChildDirectedTreatment = false, // boolean
             TagForUnderAgeOfConsent = false, // boolean
             MaxAdContentRating = "MA" //  string | G | PG | T | MA
   );
}

// call _targeting();

https://developers.google.com/admob/android/targeting

emi-indo-cordova-plugin-admob - [email protected]

Published by EMI-INDO over 1 year ago

New Features

  • Interstitial | Rewarded | Rewarded Interstitial
    responseInfo = true, // boolean (debugging)

https://github.com/EMI-INDO/emi-indo-cordova-plugin-admob/blob/main/example/index.html

New Consent

emi-indo-cordova-plugin-consent
https://github.com/EMI-INDO/emi-indo-cordova-plugin-consent

Fund Features

https://github.com/EMI-INDO/emi-indo-cordova-plugin-admob/discussions/categories/fund-features

Bug fix

  • Flashing banner ads
emi-indo-cordova-plugin-admob - [email protected]

Published by EMI-INDO over 1 year ago

  1. Anchored_adaptive
  2. Inline_adaptive
  3. adaptiveWidth = 320 // default: 320
  • New Features getSdkVersion

cordova.plugins.emiAdmobPlugin.initialize(function(getVersion){},

     function getVersion(SDK) { alert("SDK Version: " + SDK) }

   );
  • New Features get Mediation Adapter Name

Example code
https://github.com/EMI-INDO/emi-indo-cordova-plugin-admob/blob/main/example/getMediationAdapterName.html

emi-indo-cordova-plugin-admob - [email protected]

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.

emi-indo-cordova-plugin-admob - [email protected]

Published by EMI-INDO over 1 year ago

Banner Ads
Interstitial Ads
Rewarded Ads
Rewarded interstitial Ads