-
-
Notifications
You must be signed in to change notification settings - Fork 843
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
3.4.0 beta (supports Ask next time, Only this time, etc) #696
Conversation
This version will reintroduce this error: facebook/react-native#30158 Quite a regression, but there is currently no way to correctly detect a The Android permission system is broken as its core and nobody at Google seems to care 🤷🏻♂️ |
I updated the Android flow chart: What I recommend to keep a "good" UX on Android:
It's not perfect for two reasons:
But I'm afraid we can't achieve better. |
@artyorsh Hi! No plan for now since I still struggle a bit to get company sponsorships. If your company need it quickly, you can contact me and I will put high priority on it 🙂 |
@zoontek thanks for the quick response! I respect your motivation with the sponsorships - the permissions library is definitely worth it 🙂 For the Android 13 topic - most of the apps will have to upgrade to a new notification permission requirement (which doesn't necessarily involve new arch migration). Given the fact that it's available in Platform Stability, can we have a look on what other libraries do and raise the topic also in this library? I would be happy to contribute with moving the code from there to this package and checking it on emulators but I don't have a physical Android 13 device |
@artyorsh I will update the call for sponsors post. Indeed it's not related to the new architecture, but we need a way to make libraries development sustainable. |
I saw that my PR for notifee is mentioned. I'll be happy to assist with adding newly introduced permission in Android 13 |
@zoontek Hi, So how could you avoid this kind of problem in user experience? |
@Irenedan You can't. Previous versions of To understand the issue with the Android permission system here: Before Android 11, a permission request couldn't be dismissed, we have to grant or denied it. On the second try, the user had a checkbox "Never ask again". As after the first try, android But since Android 11, as the permission request can just be dismissed, if
As the app briefly lose focus even if no popup appear, the only crappy hack that come to my mind would be to measure how many time it took to the user to deny. Far from perfect, but until Google fixes this we have no other choices than hacks like that. And this king of stuff couldn't be included in this library since it would not work with More infos: https://developer.android.com/training/permissions/requesting |
Hello, I tried to use 'yarn add react-native-permissions@next', but the app crashes when the user selects the option 'Only this time' Phone: One plus with Android 12 |
@Irenedan Use Edit: Just tried it, no issue from the library (Google Pixel 4a, android 12): |
This phrase should always be followed with "...and here's the stack trace from |
Hi everyone 👋
In order to fix this irritating issue and others like "Only this time" permission grant on Android >= 12, I decided to remove
SharedPreferences
usage in the Android part of the module. Which mean thatcheck()
could now only respond withRESULTS.UNAVAILABLE
,RESULTS.GRANTED
orRESULTS.DENIED
and you cannot be sure that the permission isn'tRESULTS.BLOCKED
until you request it. And even after that, thecheck
method will continue to returnRESULTS.DENIED
.This is far from perfect, but is related to how the Android permission works. See this comment to understand it better.
Try it!
You can try it using
yarn add react-native-permissions@next
and give your feedbacks ✨For that, I also updated the example app (on this branch):