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

Location #59

Closed m6246 closed 7 years ago

m6246 commented 7 years ago

How would one provide config.location? I'm not sure about iOS but for Android this is a native object (https://developer.android.com/reference/android/location/Location.html)

ratson commented 7 years ago

@m6246 How this is related to AdMob?

m6246 commented 7 years ago

Hi Ratson, is is used for targeting purposes.

https://github.com/ratson/cordova-plugin-admob-free/blob/d44d91e8a053f09a8af477d6b5ec23308c5530bf/src/android/AdMob.java#L188

While there is native code to set it from the config, it seems impossible to hand it over from the javascript side.

Also, the docs don't mention the location option https://ratson.github.io/cordova-plugin-admob-free/function/index.html#static-function-setOptions https://ratson.github.io/cordova-plugin-admob-free/typedef/index.html#static-typedef-BannerConfig

I'm not into iOS programming so not sure what is needed there, but I guess being able to provide the javascript config with a config.location = {lat, long} would enable both native backends to construct native location objects?

m6246 commented 7 years ago

Actually.. I just found about this, doh

https://github.com/ratson/cordova-plugin-admob-free/blob/d44d91e8a053f09a8af477d6b5ec23308c5530bf/src/android/AdMobConfig.java#L123

So this basically answers my question. Still worth adding to the docs though ;)

ratson commented 7 years ago

Documentation added, see https://ratson.github.io/cordova-plugin-admob-free/typedef/index.html#static-typedef-BaseConfig