phonegap / phonegap-plugin-push

Register and receive push notifications
MIT License
1.94k stars 1.91k forks source link

Prevent dismiss notification #1162

Open cristianoventura opened 8 years ago

cristianoventura commented 8 years ago

Is there a way to show a fixed notification, like Android update notification, forcing user to click on it ?

Because If user dismiss the notification and open the application later, all data is gone.

macdonst commented 8 years ago

@cristianoventura it is possible but it is not implemented. It would be a simple to add the on going feature: https://developer.android.com/reference/android/support/v4/app/NotificationCompat.Builder.html#setOngoing(boolean)

galvanu commented 7 years ago

Can handle this one, the question if this is a configuration for all notifications (which will be passed) during the init method or this is kind of specific for each notification which will come as part of the payload?

fredgalvao commented 7 years ago

I'm pretty sure that'd be specific to each notification payload, specifying if it's meant to be sticky or not.

galvanu commented 7 years ago

So I guess it will be something like:

"data": { "title": "Large Icon", "message": "Loaded from drawables folder", "image": "twitter", "ongoing": true }

The question is if push.clearAllNotifications method is good enough for this scenario in order to clear ongoing notifications?

fredgalvao commented 7 years ago

Maybe add a flag parameter to that method, like alsoClearOngoing, defaulting to false for api compatibility.

hoabuiduy commented 6 years ago

Should we have setAutoCancel value true/false? Because i would like to keep notifications after click on them