i am facing problem related to requestPermissionAsync this method does not show prompt to the user. Any help would be highly appreciated
Android Version: 12 Expo SDK: 47
i am facing problem related to requestPermissionAsync this method does not show prompt to the user. Any help would be highly appreciated
Android Version: 12 Expo SDK: 47
Copyright © 2021 Jogjafile Inc.
I'm having the same problem on android 12 and expo SDK 48. Here's something from the android developer docs to keep in mind :
This implies that on all android versions below 13, all newly installed apps are automatically granted notification 'permissions' when they are installed. This remains so until users opt out of receiving notifications from the app. You can check and see, any app you install is automatically allowed to send notifications on android versions below 13.
This means that given the design of the OS, you don't have to ask for it again. If you still do anyways, it still does not show up. Here's why :
So when you try requesting notification permissions with the permissions system, as is done with expo and many other platforms, the phone does nothing if its android 13 and below because you're asking for something it doesn't have for you, a notifications 'permission'. Thus
requestPermissionsAsync()does nothing with those versions.Lastly, information from android developer docs indicates that the only way to allow permissions again is if the user manually does so. Otherwise, developers can't request it again from the app. See that here
It may thus be good to include a brief explanation of why users should allow your app notification permissions so that if they should ever disable it, they are likely to be reminded and thus grant it to the app again.