Cordova Slack Digest

Thu, 05 May 2022 08:22:08 GMT

User count: 4689

Join the conversation at slack.cordova.io

Channel #cordova-android (2 messages)


Wed, 04 May 2022 16:21:40 GMT

@info460 says

I have still a problem with using GPS in my app.

  1. To get GPS enabled from the app( plugin request location accuracy) + to get consent from user I need to call GPS location by geolocation plugin but people say that Google does not like to call GPS coords when they are not needed for some specific functionality
  2. If I call above mentioned directly before showing user location on the map, loading map fails (I.need to reload the page formap to work, I think I need to call async...)

anyway my question is how you handle user content and enabling GPS from the app ??

Wed, 04 May 2022 17:15:11 GMT

@norman137 says

In my applications I don't rely on the permissions of the geolocation library (or any library that uses permissions really)

I use the diagnostics plugin to check for and request permissions at very specific times. Additionally there are also APIs that checks for whether the user has GPS disabled or if they don't have high accuracy enabled, which can be used to inform the user about potential issues if your app requires the high precision.

https://github.com/dpa99c/cordova-diagnostic-plugin

Keep in mind by default, the diagnostic plugin will load up all ofit's modules which will add a lot of permission declarations to your app, So read https://github.com/dpa99c/cordova-diagnostic-plugin#specifying-modules to learn how to only install the specific modules you need.