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
notification clear when app close from home btn in android #1658
Comments
@rajan2ram try beta.3 |
@Tawpie it's not fixed in beta.3 |
@ghost since the easy answer isn't the correct answer, can you be more descriptive with what you mean by your expected behavior "Local notification should not be close"? My expectations are that when the user hits the home button, the app and all of its windows will go away (close). All of my app's notifications that were in the notification shade will also be cleared and will no longer appear in the notification shade. Can you be very specific about what are you wanting to happen? (for example: when the app is running and a local notification is displayed, when I hit the home button the local notification should _____________ ) |
AFAIK this is the expected and default behavior on both IOS and Android. If you want to keep the notifications visible you have to reschedule them again, however this is not the behaviour that most applications should use. |
when the app is running and a local notification is displayed, when I hit the home button the local notification should still be visible. For example how it does Google drive when user is downloading file. |
ah. That simply won't happen. The phone's operating system (Android/iOS) controls what happens when the home button is tapped and there's nothing your app or its plugins can do to change that. Right now, mobile devices will close all windows associated with your app when you tap the home button. Google (being the owner of Android) may give its apps extra permissions to do special things, but third party apps and especially ones based on packagers like Cordova have no ability to modify the OS behavior. It's a lost cause… |
Hmmm. Maybe we should use push notifications instead... |
Accroding to Android documentation:
Is it not about local notifications? So maybee this is a cordova related problem, not the OS itself? |
AFAIK the action of starting an app up removes all the notifications. I know that when I send push notifications down to both IOS and Android, starting the app up OR resuming the app from the background means the notifications are removed. That's the action for local notifications, OneSignal and PushWoosh remote notifications. We have always assumed that is the case and indeed we write code to reschedule local notifications that we want the user to see. |
@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:
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. |
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":
|
notification clear when app close from home btn in android
cordova -v
): 8.0.0cordova platform ls
): 6.3.0* Plugin configExpected 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
The text was updated successfully, but these errors were encountered: