Home:ALL Converter>How to prompt iOS user for geoLocation service permission in Ionic

How to prompt iOS user for geoLocation service permission in Ionic

Ask Time:2020-06-03T01:32:22         Author:D.Hodges

Json Formatter

I've created a social media app that uses geoLocation services. It's an Ionic 4 app with a Firebase backend. GeoLocation services are working with Android but with iOS it's not prompting users for geoLocation access.

I've been looking but can't find an example of how to prompt users for GeoLocation service permission on Platform ready.

Any example on how to check for location services permissions and then prompt a user for location services permissions would be greatly appreciated.

And I assume this would be added to the app.component.ts file.

Author:D.Hodges,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/62157903/how-to-prompt-ios-user-for-geolocation-service-permission-in-ionic
Sébastien :

You're not supposed to prompt for permission until you request a location. When you ask for a location the first time the permissions system prompt will be displayed.\n\nIf you want to check the permission status for Geolocation at any time you can use the \ncordova-diagnostic-plugin plugin (there is an Ionic wrapper).\n\nOnce installed you can enquire about permissions, status, etc.:\n\nthis.diagnostic.isLocationAvailable(); // returns a promise\nthis.diagnostic.isLocationAuthorized(); // returns a promise\n// etc.\n",
2020-06-02T19:05:35
yy