[英]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.