question

66074517 avatar image
0 Votes"
66074517 asked WenyanZhang-MSFT edited

Disable Location Permission

Hi,

In Xamarin, how can I disable the Location permission for both iOS and Android?


Thanks,
Jassim

dotnet-csharpdotnet-xamarin
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

ELBANNOUNIMOHAMMED-6711 avatar image
0 Votes"
ELBANNOUNIMOHAMMED-6711 answered

Vous pouvez contrôler les informations de localisation que votre téléphone peut utiliser. Ouvrez l’application Paramètres de votre téléphone. Sous « Personnel », appuyez sur Accès à la localisation. En haut de l’écran, activez ou désactivez l’accès à ma position.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

sreejukg avatar image
0 Votes"
sreejukg answered

In XAMARIN, you may define the application wide permission for your app by using Manifest. See the following references:

Android: https://docs.microsoft.com/en-us/xamarin/android/app-fundamentals/permissions?tabs=windows
iOS: https://docs.microsoft.com/en-us/xamarin/ios/app-fundamentals/security-privacy?tabs=windows

If you want to revoke the permission for your app, you can update the info.plist (for iOS) or in the Android Manifest.


It is also possible to request permission by code. For e.g. developers use [Xamarin.Essentials][1] to manage the permissions in the code. Your application need to request for permissions in your app. See the following references

https://docs.microsoft.com/en-us/xamarin/ios/app-fundamentals/security-privacy?tabs=windows
https://docs.microsoft.com/en-us/xamarin/essentials/permissions?tabs=android


You may need to refer your code to see to see whether your application is requesting permissions through code.

Hope this helps

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.