notification clear when app close from home btn in android
See original GitHub issuenotification clear when app close from home btn in android
- Plugin version: 0.9.0-beta.2
- Platform: Android
- OS version: 7.1.1
- Device manufacturer / model: Motorola - G5 s plus
- Cordova version (
cordova -v
): 8.0.0 - Cordova platform version (
cordova platform ls
): 6.3.0* Plugin config
Expected Behavior
LocalNotification should be not close when app close by home button in android
Tell us what happens instead
Loacl notification close whn app close
Issue Analytics
- State:
- Created 5 years ago
- Comments:11
Top Results From Across the Web
Control notifications on Android - Google Support
Use notifications · To clear one notification, swipe it left or right. · To clear all notifications, scroll to the bottom of your...
Read more >How to get rid of a permanent notification on Android
To remove a persistent notification on Android as fast as possible, first, press-and-hold on it. Alternatively, swipe the notification left or ...
Read more >Cancel notification after application is closed from background
Notification can be canceled if we canceled it in onTaskRemoved() method,do mNotificationManager.cancel(NOTIFICATION_ID) in that ...
Read more >Tasks and the back stack - Android Developers
The user uses the Home button or gesture, then starts a new app from the app launcher. When the Home screen appears, Task...
Read more >View and respond to notifications on iPad - Apple Support
Handle a notification you receive while using another app: Pull it down to view it, then swipe up to dismiss it. Clear notifications:...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This behavior might be seen when you use local notification plugin in combination with phonegap-push plugin. phonegap-plugin-push by default clear all pending notifications when the app go in pause. To fix this behavior, just set the clearNotifications to “false”:
var push = PushNotification.init({ android: { clearNotifications:"false" } });
@rwillett yes, maybe when the app is starting it works so, but notification get removed once app getting to the background mode. That’s the main problem.
BTW, I tested in iOS and it works as expected. When I preseed “home”, application got into background and notification still present in notifications area. Then I locked and unlocked iOS - notification still there. I closed and re-ran application - notification has not been removed. It still visible in notifications area until user manually remove it.
For Android, once application lose focus - all notifications are getting removed.
UPD: Tested with autoClear: false - nothing changed I consulted with Android developer and he confirmed - this is not default behaviour and sent me a link with quotes
link2
So in current implementation for android 8 notification are quite useless.
Also in example there is a notification on locked screen, but currently if I will lock screen - notification will disappear.