-
Notifications
You must be signed in to change notification settings - Fork 201
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
Android12 Notifee not correctly handling new REQUIRE_EXACT_ALARM permission #239
Comments
Turns out this mandatory or you get a crash when setting triggers |
…permission Related #239 https://developer.android.com/about/versions/12/behavior-changes-12#exact-alarm-permission Notifee still needs to: - expose platform API `canScheduleExactAlarms` - Intent ACTION_REQUEST_SCHEDULE_EXACT_ALARM to send users to settings screen and - ACTION_SCHEDULE_EXACT_ALARM_PERMISSION_STATE_CHANGED receiver to reschedule alarms
My commit fixes the hard crash out of the box but if permission is revoked, it will still crash after Notifee still needs to:
|
I have fixed the crashes by at least guarding trigger creation in case a user or the system removes it. This will show up in the logs if trigger settings was not possible:
This method: needs some way to propagate back through the call chain that it was unsuccessful but that is an API design question
First goal is just to not crash |
…permission Related #239 https://developer.android.com/about/versions/12/behavior-changes-12#exact-alarm-permission Notifee still needs handle these items: - warn API callers through promise rejection if scheduling a trigger was not possible - expose platform API `canScheduleExactAlarms` - Intent ACTION_REQUEST_SCHEDULE_EXACT_ALARM to send users to settings screen and - ACTION_SCHEDULE_EXACT_ALARM_PERMISSION_STATE_CHANGED receiver to reschedule alarms
…permission Related #239 https://developer.android.com/about/versions/12/behavior-changes-12#exact-alarm-permission Notifee still needs handle these items: - warn API callers through promise rejection if scheduling a trigger was not possible - expose platform API `canScheduleExactAlarms` - Intent ACTION_REQUEST_SCHEDULE_EXACT_ALARM to send users to settings screen and - ACTION_SCHEDULE_EXACT_ALARM_PERMISSION_STATE_CHANGED receiver to reschedule alarms
…permission Related #239 https://developer.android.com/about/versions/12/behavior-changes-12#exact-alarm-permission Notifee still needs handle these items: - warn API callers through promise rejection if scheduling a trigger was not possible - expose platform API `canScheduleExactAlarms` - Intent ACTION_REQUEST_SCHEDULE_EXACT_ALARM to send users to settings screen and - ACTION_SCHEDULE_EXACT_ALARM_PERMISSION_STATE_CHANGED receiver to reschedule alarms
…lag (#240) * test(e2e): use android12 emulator image in CI Related #238 * test(ci): run checks on all push events without a constraint on minutes, we should run CI on any push This gives CI support out of the box to developers working on code before they make a pull request * fix(android, API31): specify intent mutability / fix Android12 crash See: https://developer.android.com/about/versions/12/behavior-changes-12#pending-intent-mutability Fixes #238 * fix(android, deps)!: use workmanager 2.7.1, requires minCompileSdk 31 This is required for Android 12 support, and fixes the crash noted in #240 * fix(android, triggers): avoid Android12 crash w/SCHEDULE_EXACT_ALARM permission Related #239 https://developer.android.com/about/versions/12/behavior-changes-12#exact-alarm-permission Notifee still needs handle these items: - warn API callers through promise rejection if scheduling a trigger was not possible - expose platform API `canScheduleExactAlarms` - Intent ACTION_REQUEST_SCHEDULE_EXACT_ALARM to send users to settings screen and - ACTION_SCHEDULE_EXACT_ALARM_PERMISSION_STATE_CHANGED receiver to reschedule alarms * fix(android, deps): move permission to lib Co-authored-by: Helena Ford <helenaellieford@gmail.com>
@mikehardy I believe this is fixed, right with v4.0.0? Can we close this? |
@helenaford I re-titled this, right now if the user removes the new permission via system settings Notifee will silently fail to set alarms. That's a major unexpected surprise for devs using the package I believe. And there are no methods exposed to allow devs to interrogate the state of the permission via the new Android 12 APIs, so it would be silent with no recourse. Until the permission for REQUIRE_EXACT_ALARM is handled more thoroughly I think this is an open issue |
This allows consumer to check whether they can trigger exact timestamp notifications for Android >= 12. See: invertase#239
This allows consumer to check whether they can trigger exact timestamp notifications for Android >= 12. See: invertase#239
Will default resolve nothing in iOS and Android < 12. Otherwise, open alarm and reminders permission settings for the app See: invertase#239
For this issue, I have
Working on the last one now, will submit a PR after I've finished
|
Should this issue be Closed now? |
@bytehala yes. will close. thanks 🙏 |
Saw this: https://developer.android.com/about/versions/12/behavior-changes-12#exact-alarm-permission
As I was working through #238 / unrelated Android12 behavior change
The text was updated successfully, but these errors were encountered: