[英]Is it possible to delete specific push notifications from the Notification Center?
[英]iPhone - Push notifications removed from notification center
在我正在开发的iOS应用中,当发送推送通知时,会出现一个弹出窗口,但是如果用户不点击它,则通知会丢失,甚至不在错过的通知中心。
我该如何解决?
只需在代码中添加这些行即可。 设置setApplicationIconBadgeNumber = 0
int badgeCount = [UIApplication sharedApplication].applicationIconBadgeNumber;
[[UIApplication sharedApplication] setApplicationIconBadgeNumber:0];
[[UIApplication sharedApplication] cancelAllLocalNotifications];
[[UIApplication sharedApplication] setApplicationIconBadgeNumber:badgeCount];
请参阅此以获取矿石信息从通知中心删除单个远程通知
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.