Search code examples
xamarin.formsxamarin.androidpermissions

How to customize text in permission dialog in Xamarin.forms for Android?


I make a Xamarin.Forms App and making permissions for location,camera etc. I made custom text permission dialog in IOS for location like this:

<key>NSLocationWhenInUseUsageDescription</key>
    <string>Test Message.</string>

but i can't find how to make it in Android. Any suggestion?


Solution

  • The short answer is, you can't.

    As per Android's documentation:

    Note: Your app cannot customize the dialog that appears when you call launch(). To provide more information or context to the user, change your app's UI so that it's easier for users to understand why a feature in your app needs a particular permission. For example, you might change the text in the button that enables the feature.

    What you can do, and they advise the developers to do, is to adjust your UI or display a pop-up describing why you'll require the specified permission.