EMI-INDO / emi-indo-cordova-plugin-admob

Cordova Plugin Admob Android | IOS
ISC License
12 stars 2 forks source link

Collapsible & banner ads display above the content #26

Open merbin2012 opened 2 days ago

merbin2012 commented 2 days ago

Today I have decided to move from admob-plus to your awesome plugin. But in the implementation time, I was just check the banner ad only, it had the following issues.

I have tried the following code

emi-bug

1) In the above code, the adaptive banner ad is displayed and compared to the admob-plus plugin working very well. But it displays above the content, so it should be a problem, manually adjusting the CSS or HTML code is not a standard way.

2) collapsible ad also not showing

3) Documentation issue, one careless mistake is there, you have used "}" instead of ")" console.log("AdUnitId: " + data.adUnitId}; => console.log("AdUnitId: " + data.adUnitId);

Please fix those problems, and kindly let me know.

EMI-INDO commented 1 day ago

@merbin2012

sorry it looks like the documentation I made was wrong, I will update it later, the correct example

const bannerConfig = {

   adUnitId: "ca-app-pub-3940256099942544/9214589741", //Banner_ID,
   position: "bottom-center",
   size: "responsive_adaptive", // autoResize: true (only responsive_adaptive)
   collapsible: "bottom", // position: top | bottom (disable, empty string)
   autoResize: true, // on.screen.rotated === orientation.portrait || on.screen.rotated === orientation.landscape
   autoShow: true, // boolean

}

cordova.plugins.emiAdmobPlugin.loadBannerAd(bannerConfig,
// (Optional)
(data) => {
    // this data will be displayed after showBannerAd() applies to all ad types
    console.log("Micros: " + data.micros);
    console.log("Currency: " + data.currency);
    console.log("Precision: " + data.precision);
    console.log("AdUnitId: " + data.adUnitId};

     },
    (error) => {

     console.error("Error: " + error);

    }

);

https://developers.google.com/android/reference/com/google/android/gms/ads/AdValue

Key Point: getValueMicros() returns the value of the ad in micro units. For example, a getValueMicros() returned value of 5,000 means the ad is estimated to be worth $0.005.

merbin2012 commented 1 day ago

@EMI-INDO Please note, not only documentation issues, two more issues are mentioned. Also, "data.micros" and all of you mention properties are undefined.

EMI-INDO commented 22 hours ago

@merbin2012

https://support.google.com/admob/answer/11322405

Turn on the setting for impression-level ad revenue in your AdMob account: Sign in to your AdMob account at https://apps.admob.com. Click Settings in the sidebar. Click the Account tab. In the Account controls section, click the Impression-level ad revenue toggle to turn on this setting.

merbin2012 commented 22 hours ago

Ooh, ok. Thanks for the information. Please let me know once all the issues are fixed.