Skip to content
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

[Android 12] Crash when tapping on Notification action button due to use of Intent.ACTION_CLOSE_SYSTEM_DIALOGS #1543

Closed
jkasten2 opened this issue Mar 9, 2022 · 2 comments

Comments

@jkasten2
Copy link
Member

jkasten2 commented Mar 9, 2022

Issue

The handleDismissFromActionButtonPress method in this SDK uses Intent.ACTION_CLOSE_SYSTEM_DIALOGS however in Android API Level 31 (Android 12) this requires a new permission.

Solution

The logic in handleDismissFromActionButtonPress was written in 2016 in PR #18 so it is likely things have changed with Android. We should attempt to remove handleDismissFromActionButtonPress to see if it correctly closes the notification shade in Android 12. If it does we can then go back to older versions of Android support by the SDK (Android 4.1 at the time of writing) to see if we still need it as well. If it is still required we can simply omit it if the device is running API level 31 or newer.

Workaround

Setting your project to useandroidSdkVersion to 30 would most likely workaround this issue until this is resolved.

@vincent-paing
Copy link
Contributor

Will submit a PR to fix this

vincent-paing added a commit to vincent-paing/OneSignal-Android-SDK that referenced this issue Mar 15, 2022
vincent-paing added a commit to vincent-paing/OneSignal-Android-SDK that referenced this issue Mar 15, 2022
@nan-li
Copy link
Contributor

nan-li commented Apr 8, 2022

The crash fix has been released in version 4.7.1.

For now, I will still leave this issue open in case users cannot upgrade yet and can use the workaround.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants