-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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 (SDK 31+): Tap on notifications only opens app when notifications are grouped. #1990
Comments
Related: |
I have the same issue... |
The issue and solution is described here: |
@bhandaribhumin or @DavidTalevski could you look please at it? |
Can you try my fork and confirm if the issue persists there? |
The app still doesn't open when i click on the notification. I have also a refresh button at the notification which refresh a random number in the notification. This button also doesn't work anymore with your fork. |
Are there any errors reported in logcat? |
Tested again. The refresh button works (don't know what happens at the first test) but the app doesn't come in foreground / open when clicking on the notification. Logcat:
|
@DavidTalevski I use your fork because it's most recent and the issue occurs in your fork as well. The log cat error is |
Currently I don't have an android 12 phone available, nor can I simulate one, in order to reproduce the issue and implement the fix. I might be able to get my hands on one next week. If someone implements the fix I will be more than happy to include it in my fork. |
@rafaellop please use my fork version https://github.com/bhandaribhumin/cordova-plugin-local-notification-12, this version includes all latest fixes and also compatible with sdk 30,31,32 and 33 as well. Also use this method to request permission https://github.com/bhandaribhumin/cordova-plugin-local-notification-12#setdummynotification This plugin also available on npm https://www.npmjs.com/package/cordova-plugin-local-notification-12 |
@bhandaribhumin I'll try but from what I have see in the repo your fork also doesn't refer the trampoline so I don't expect it works, but I'll try just to confirm that. Update: Same thing and the same error using your fork. Sorry. |
Please take a look when you have the v12 phone. Thank you. |
I realized that when I closed the app with the back button |
Hi Rafellop |
@DavidTalevski have you maybe managed to put your hands on an Android 12 device to verify that? |
Hi Rafaellop. I am using local notifications and the local notifications 12 is not supporting the events subscription, are you able to resolve this on your fork also? I need the event onTrigger on the local notifications. The code below works on lower version of the plugin are you able to set this up on your fork. onDeviceReady() { |
Are you able to subscribe to events on your fork version?. I'm using this plugin and the android 12 is not subscribing to events onTrigger. Your assistance will be much appreciated. |
No event works properly. |
I have installed this fork link https://github.com/bhandaribhumin/cordova-plugin-local-notification-12 last week, l can assure you the events function call below does not register when the Local notification is triggered. Please sent me the right fork link of the local notifications l can reinstall a new one. onDeviceReady() { Below is my package JSON |
But I just told you that no event works properly. |
My apologies of the misinterpretation of your comment, the events is this something in progress or there is no hope on the plugin? |
Hi, |
Hi Powowbox. Does your fix also include other events e.g ontrigger code below. |
Hi bevinGithub,
the trigger event is correctly raised and received in The click event works also correctly. |
Hi Powowbox. I am using ionic l will try install your version and test it thanks very much for the response. i have install your version with the command below: How do l import the cordova plugin in ionic for the same pluginin documentation is like below |
Sorry, I can’t help I don’t use awesome-cordova-plugins. |
Im just showing you how l import awesome-cordova-plugins. I want to know how to import your cordova plugin in ionic. |
use |
Hi powowbox. I have managed to to get your fork working now, the issue was to get the var reference of the cordova in ionic and call the function as you supplied before, thanks for your assistance the notifications events are working now. |
hi Powowbox. The setting triggerInapp does make the plugin subscribe to events but stops the notification being displayed in the phones default notifications area even if the foreground setting is true. Is there way to show the notification popup if the app is closed as the phone just vibrates and the light is on and plays the sound and no popup of notification these are the settings l have |
@bhandaribhumin Hi, thanks for merging my changes. I haven't done any test on your merge, I only look at the merge. It sounds good. |
Hi, @bevinGithub
` Following the code above, it seems the behaviour you describe corresponds to the expected one. There is one last case, that sounds to not be correctly handled: when the app is in background, the notification isn't displayed in the notification center even if the app cannot displayed show it to the user. I can try to fix it. |
hi Powowbox. If i add the triggerInApp: true, the events are subscribing but the app is not showing the Notification in the notifications center. if triggerInApp: false, l want the subscribing to event onTrigger to still work as it is currently only working when triggerInApp: true, only |
If I understand well, if triggerInApp is set to true, you want to display the notification in any case, the app is visible or not. It's a very specific need. You can make your own fork. To have the expected behaviour, in the file AbstractNotificationReceiver, change the condition in `
` Remove !options.triggerInApp() from the test and you should have what you want. |
Hi Powowbox. My programming skills are only limited to ionic angular i have zero skills on modifying plugins. If l remove the triggerInApp: Yes l am not able to subscribe to event onTrigger, the below code will not work if triggerInApp is false or is removed completely. onDeviceReady() { |
Hello @bevinGithub you can use this method to prompt for runtime permission. |
Hi Bhandaribhumin. I am looking to just get trigger events after the notification triggers l subscribe to the event onTrigger to play custom audios or sound. if i have the code below, triggerInApp: true does make evet subscrition happen if l set it to false the trigger events don't work |
Hey! Click on the notification doesn't open my App. I have a "refresh" button in my notification to update the notification with a random number. Clicking the refresh button open the app but clicking the notification does nothing. The app should open when clicking the notification and should not open but update the notification text when clicking the refresh button. |
@Filavision Hi. |
Some info to actually explain why "tap on notifications" does not open the app in Android 12: @powowbox I see you've refactored |
@fquirin |
Saw that and I think it makes total sense 👍 . Any other breaking changes? [EDIT] One more question @powowbox : The previous |
@fquirin |
I've merged all changes from @timkellypa, @bhandaribhumin and @powowbox into my own fork, so we could create a PR for the original repository. But since there are so many changes now, I doubt this PR would ever be accepted 😅 |
Hi guys are you able to do a fix on IOS for local notifications? events triggering when app is in the background is not subscribing to events IOS 16 |
@bevinGithub I'm not familiar with the iOS code, sorry. |
How did you do that please? |
This is solution for my problem. Thanks! |
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
cordova -v
): 11.0.0cordova platform ls
): android 10.1.1Expected 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
Context
Open app when tapping notification
Debug logs
NotificationService: Indirect notification activity start (trampoline) from com.xxx.xxx blocked
The text was updated successfully, but these errors were encountered: