从通知中心删除单个远程通知 [英] Remove single remote notification from Notification Center

查看:122
本文介绍了从通知中心删除单个远程通知的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用从Apple服务器收到远程通知。

my app receives remote notification from Apple server.

当用户点击通知中心时,是否可以从通知中心(iOs 5.0+提供的下拉菜单)中删除单个远程通知?

Is there a way to remove a single remote notification from notification center (the drop-down menu available from iOs 5.0+), when the user taps on it?

谢谢!

推荐答案

从iOS SDK 5.0开始,无法删除特定通知。从您的应用中删除所有通知以便用户在其中一个用户打开应用时不会在通知中心中显示的方法是将应用徽章设置为0,如下所示:

There is no way to remove a specific notification as of iOS SDK 5.0. The way to remove all the notifications from your app so they don't show in the Notification Center when the user opens the app from one of them, is to set the app badge to 0, like this:

[UIApplication sharedApplication].applicationIconBadgeNumber = 0;

编辑:在iOS 8上,当你点击时,SpringBoard似乎会自动解除通知它在通知中心打开应用程序。

这篇关于从通知中心删除单个远程通知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆