Firemonkey Reask GPS Permission and check if GPS is enabled for iOS


I have a Firemonkey Multi device project and I want to know if my GPS is enabled and also if a user hasn’t given my app the permission to use the GPS to reask it.

Right now once a user doesn’t give permission, the user won’t be asked again. If you want to change it you have to go to your device settings to your app and allow GPS through there. I want to do this through my app.

And check if GPS is enabled, because if it’s disabled it won’t even ask for GPS permission. Maybe option to force enable GPS?

I do know how to check if you have permission to use GPS for your app with code below:

if LocationSensor1.Sensor.Authorized = TAuthorizationType.atAuthorized then
//Permission to use GPS

To bad this property is read only and can’t be set

Comments are closed.