Control device location

I want to turn on / off device location using the ionic app. Not from device setting. Like UBER doing it within the app. Please help me.


After click OK, it turn on the device location.