简体   繁体   English

禁止推送通知解雇

[英]Forbid push notification dismissal

I'm using Cordova Push plugin ( http://ngcordova.com/docs/plugins/pushNotifications/ ) and GCM for push notifications . 我正在使用Cordova Push插件http://ngcordova.com/docs/plugins/pushNotifications/ )和GCM进行push notifications

Is there any way via which I can forbid the dismissal of the notification ? 有什么方法可以禁止取消通知 I want it dismissed only when it's clicked and the user has entered the app. 我希望仅在单击它并且用户进入应用程序时将其关闭。

You can create an "ongoing" Notification. 您可以创建“进行中”通知。

Simply add FLAG_ONGOING_EVENT to your flags. 只需将FLAG_ONGOING_EVENT添加到您的标志即可。

Docs: http://developer.android.com/reference/android/app/Notification.html#FLAG_ONGOING_EVENT 文件: http : //developer.android.com/reference/android/app/Notification.html#FLAG_ONGOING_EVENT

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM