Android 12 (SDK 31+): Tap on notifications only opens app when notifications are grouped.
See original GitHub issueWARNING: IF YOU IGNORE THIS TEMPLATE, WE’LL IGNORE YOUR ISSUE. YOU MUST FILL THIS IN!
Provide a general summary of the issue.
Your Environment
- Plugin version:
- cordova-plugin-local-notification-12 0.1.3 “LocalNotification”
- cordova-plugin-badge-fix 0.8.10 “Badge”
- Platform: Android
- OS version: 12
- Device manufacturer / model: n/a
- Cordova version (
cordova -v
): 11.0.0 - Cordova platform version (
cordova platform ls
): android 10.1.1
Expected Behavior
On Android 12, after an app is killed or in the background, tapping on a notification does not open the app. Adb logcat shows the following:
NotificationService: Indirect notification activity start (trampoline) from com.xxx.xxx blocked
The same happens when 2 and 3 notifications from the same app have been queued up.
However, when more than 3 notifications are queued and these notifications are grouped together, tapping on any of these notifications opens up the app.
Happy to do any testing to further debug.
Actual Behavior
App should open with tapping a single notification
Steps to Reproduce
- When a single notification is triggered, tap on it. App is not opened.
- When 2 or 3 notifications are triggered, tapping on any of them doesn’t open the app.
- When notifications are grouped, tapping on any of them opens up the app.
Context
Open app when tapping notification
Debug logs
NotificationService: Indirect notification activity start (trampoline) from com.xxx.xxx blocked
Issue Analytics
- State:
- Created a year ago
- Comments:46
Hi, I’ve done a fix to make notifications clickable on android 12+. You can find it here https://github.com/powowbox/cordova-plugin-local-notification-12. If it’s ok I will make a PR. Important: add
<preference name="AndroidLaunchMode" value="singleInstance"/>
in your config.xml, to avoid to launch the app even if it’s in background.@fquirin For the change list, look at the section “Purpose of this fork” on the page of the fork. I’ve done several tests since the last two weeks on android 7, 12 and 13 and I didn’t notice any problem.