question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Android 12 (SDK 31+): Tap on notifications only opens app when notifications are grouped.

See original GitHub issue

WARNING: 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

  1. When a single notification is triggered, tap on it. App is not opened.
  2. When 2 or 3 notifications are triggered, tapping on any of them doesn’t open the app.
  3. 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:open
  • Created a year ago
  • Comments:46

github_iconTop GitHub Comments

2reactions
powowboxcommented, Nov 1, 2022

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.

1reaction
powowboxcommented, Nov 16, 2022

@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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Notifications Overview | Android Developers
Users can tap the notification to open your app or take an action directly ... On Android 12 (API level 31) and higher,...
Read more >
Behavior changes: Apps targeting Android 12
For apps targeting Android 12, notifications with custom content views will no longer use the full notification area; instead, the system applies a...
Read more >
Start an Activity from a Notification - Android Developers
To start a "regular activity" from your notification, set up the PendingIntent using TaskStackBuilder so that it creates a new back stack as ......
Read more >
Notification runtime permission - Android Developers
Android 13 (API level 33) and higher supports a runtime permission for sending non-exempt (including Foreground Services (FGS)) notifications from an app: ...
Read more >
Foreground services - Android Developers
... Notifications · Complications · Tiles · Tiles design system · Apps ... UWB · VPN · Session initiation protocol overview · Open...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found