ratson / cordova-plugin-admob-free

New development has been moved to "admob-plus-cordova", https://github.com/admob-plus/admob-plus/tree/master/packages/cordova
https://github.com/admob-plus/admob-plus
MIT License
494 stars 210 forks source link

Banner appears at unexpected position only for iOS #320

Open mshirasu opened 6 years ago

mshirasu commented 6 years ago

I am using admob-free for displaying banner advertisement. I have no problem with Android, but am facing trouble with iOS. The banner appears but at unexpected position. I can find the area at the bottom of the window but the actual banner appears at the top.

I noticed that my problem is similar to #261 , but it seems a different issue.

I am writing my code and environment.

` var admobid = {} if (/(android)/i.test(navigator.userAgent)) { // Android admobid = { banner: 'ca-app-pub-3940256099942544/6300978111' // id for testing } } else if (/(ipod|iphone|ipad)/i.test(navigator.userAgent)) { // ios admobid = { banner: 'ca-app-pub-3940256099942544/2934735716' // id for testing } }

admob.banner.config({
    id: admobid.banner,
    isTesting: true,
    autoShow: false,
    bannerAtTop: false,
    offsetTopBar: true,
    overlap: false
})
admob.banner.prepare()

`

cordova-admob-sdk 0.20.1 "AdMob SDK" cordova-plugin-admob-free 0.21.0 "Cordova AdMob Plugin" cordova-plugin-badge 0.8.7 "Badge" cordova-plugin-inappbrowser 3.0.0 "InAppBrowser" cordova-plugin-splashscreen 5.0.2 "Splashscreen" cordova-plugin-statusbar 2.4.2 "StatusBar" cordova-plugin-swift-support 3.1.1 "SwiftSupport" cordova-plugin-whitelist 1.3.3 "Whitelist" cordova-plugin-x-toast 2.6.2 "Toast" cordova-promise-polyfill 0.0.2 "cordova-promise-polyfill" cordova-sqlite-storage 2.3.1 "Cordova sqlite storage plugin" phonegap-plugin-barcodescanner 8.0.0 "BarcodeScanner" phonegap-plugin-push 2.1.3 "PushPlugin"

Cordova platform list: android 6.3.0 ios 4.5.5

android_good_position ios_bad_position

jwliang1226 commented 6 years ago

I also have this issue, is there any idea?

fabmesto commented 6 years ago

same issue, with version 0.18.0 it works correctly

jwliang1226 commented 6 years ago

Delete line 792 in CDVAdMob.m. There is no issue!

//self.bannerView.bounds = bf;

mshirasu commented 6 years ago

I have tried this workaround but it did not work unfortunately. I still have this problem.

zigou13 commented 6 years ago

@ratson Have a solution?

ivanjx commented 6 years ago

Yes im facing with same issue :( This only happens on ios.

Config:

admob.banner.config({
    id: 'xxxxxxxxxxxxx',
    autoShow: false,
    bannerAtTop: false
});

admob.banner.prepare()

Screenshot:

screenshot_35

nickgoh commented 6 years ago

Delete line 792 in CDVAdMob.m. There is no issue!

//self.bannerView.bounds = bf;

broke when the keyboard is called up

pedrogusman commented 6 years ago

Any progress on this issue?

viliamb commented 5 years ago

The same issue. The workaround is not working for me.

fthkrtl commented 5 years ago

The same issue. Any progress on this issue?

mshirasu commented 5 years ago

I have solved this issue by changing the method of WebView from UIWebView to WKWebview. I have used the following plugin.

https://github.com/apache/cordova-plugin-wkwebview-engine

In the installation guidance, it says that the config.xml configuration will be modified automatically by Cordova when installing the plugin, but in my case, I needed to add the configuration manually.

I hope this can be your help.