NativeScript / nativescript-geolocation

Geolocation plugin to use for getting current location, monitor movement, etc
Apache License 2.0
139 stars 77 forks source link

NS 6+ compatibility: .enableLocationRequest() doesn't work #246

Closed aaayushsingh closed 4 years ago

aaayushsingh commented 4 years ago

Which platform(s) does your issue occur on?

Please, provide the following version numbers that your issue occurs with:

Please, tell us how to recreate the issue in as much detail as possible.

Describe the steps to reproduce it.

lib does not request for geolocation permissions in NS 6+ on using .enableLocationRequest() method. A simple log saying No v4 support is added to console each time instead The lib internally uses "nativescript-permissions": "~1.3.0" which is outdated(I think so!?). The library is currently at version 1.3.7 and is compatible with androidx according to the latest commits there.

Temporary solution

Installed the latest nativescript-permissions library manually

Prefix1802 commented 4 years ago

For IOS 13 this also does not work i.c.w. NS 6.

Need help ASAP :)

xsterlas commented 4 years ago

I have the same problem on android 7 and NS 6.1.2. The exception on mobile: "An uncaught Exception occurred on GoogleApiHandler thread. Client must have ACCESS_COARSE_LOCATION or ACCESS_FINE_LOCATION permission to perform any location operations". I added the permissions to manifest but the error continues. Hope to help someone to find a solution...

aaayushsingh commented 4 years ago

@xsterlas @Prefix1802 add the latest nativescript-permissions lib to your project and import it anywhere. This will fix the issue

Prefix1802 commented 4 years ago

I solved it by adding:

nslocationalwaysandwheninuseusagedescription nslocationwheninuseusagedescription nslocationalwaysusagedescription

To myproject-info.plist in platforms/ios/myproject and make sure to include it in node_modules/nativescript-geolocation/platforms/ios/info.plist.

xsterlas commented 4 years ago

@aaayushsingh thank you very much! It solved the problem with all the plugins needs to use permissions.

elena-p commented 4 years ago

@aaayushsingh, thank you for your answer.

There is an issue logged in nativescript-dev-webpack that is currently in progress.

support[bot] commented 4 years ago

:wave: @aaayushsingh, we use the issue tracker exclusively for bug reports and feature requests. However, this issue appears to be a support request. Please, use Stackoverflow to get help.