Location sharing

  

Hi,

I want my app to have a feature wherein user could toggle between if location needs to shared/tracked by the app or not.

Can anyone please me in doing this.

Thanks,

Shreyas Bhondve

Hi Shreyas,

What exactly do you want to know? Your question is overly broad!

Kilian Hekhuis wrote:

Hi Shreyas,

What exactly do you want to know? Your question is overly broad!


I have used Location Plugin in my app to fetch user location. Now I have a Settings screen where I need to place a toggle switch which will allow user to turn ON/OFF location sharing.

The Switch is a Widget that's on the Toolbar?

I'm still not sure what your question is. It's just a Widget like any other, surely you must know how to use Widgets?

Kilian Hekhuis wrote:

The Switch is a Widget that's on the Toolbar?

I'm still not sure what your question is. It's just a Widget like any other, surely you must know how to use Widgets?


Yeah, I know about the switch. I am talking about the location sharing functionality when the state of the switch will be changed to ON/OFF.

When user turns the switch to ON/OFF, it should redirect them to the device's Settings screen to turn location sharing ON/OFF for the app.

So if the user switches in the app, they need to switch again? That seems user-unfriendly? Also, other apps may still want to access the location?

Kilian Hekhuis wrote:

So if the user switches in the app, they need to switch again? That seems user-unfriendly? Also, other apps may still want to access the location?


What I mean to say is, the app's permission to access the user location should be controlled using this switch. If user turns it OFF, the app's permission to access location is revoked while if it is turned ON then the permission is invoked again.

Right. But you can't do that, can you? An app can't give itself permission to a device, obviously. I'm not sure whether an app can "unregister" itself from a permission (and it might be different for iOS and Android).