0

NOTE: This question IS NOT for customizing the text in a permission request dialog (shouldShowRequestPermissionRationale() mentioned in OP).


Are the message strings displayed when calling requestPermissions() standard, or vendor specific? Are these strings accessible for reuse?

In OnRequestPermissionsResult(), if the user denies Android.Manifest.Permission.WriteExternalStorage, I would like to show a dialog saying "<app-name> requires " + "Allow <app-name> to access photos, media, and files on your device" (or something to that effect), instead of writing a different message like "SD-Card write access required to continue." (which is something more suited shouldShowRequestPermissionRationale()).

I'd prefer the messages match to avoid confusion, so that when the user is re-prompted they know exactly what permissions are required to allow.

Here is an example of my usage of OnRequestPermissionsResult

enter image description here

samus
  • 6,102
  • 6
  • 31
  • 69
  • Possible duplicate of [Provide custom text for Android M permission dialog](https://stackoverflow.com/questions/32942909/provide-custom-text-for-android-m-permission-dialog) – oldcode Jul 24 '17 at 16:29

1 Answers1

2

Are the message strings displayed when calling requestPermissions() standard, or vendor specific?

Anything can be changed by device manufacturers. Even for the subset of devices that are part of the Google Play ecosystem, message text like this could be changed.

Are these strings accessible for reuse?

They appear to come from the description of the <permission-group> to which your permission belongs. Presumably you can use PackageManager and PermissionGroupInfo to get the values at runtime.


update(samusarin):

PermissionGroupInfo pgi = this.PackageManager.GetPermissionGroupInfo(Android.Manifest.Permission_group.Storage, PackageInfoFlags.Permissions);
string desc = pgi.LoadDescription(PackageManager);
samus
  • 6,102
  • 6
  • 31
  • 69
CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
  • I got close (thanks) https://stackoverflow.com/questions/33837198/given-a-permission-name-how-do-i-find-the-permissiongroup – samus Jul 24 '17 at 20:55