如何从LocalNotification删除取消的ApplicationIconBadgeNumber? [英] How to remove the cancel ApplicationIconBadgeNumber from LocalNotification?

查看:42
本文介绍了如何从LocalNotification删除取消的ApplicationIconBadgeNumber?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的应用中使用LocalNotification.它工作正常,但是一旦设置了ApplicationIconBadgeNumber,就无法将其从App中删除.如何删除它?

I am using LocalNotification in my app. It is working fine but once ApplicationIconBadgeNumber is set, not able to remove it from App. How to remove it?

推荐答案

您需要设置应用程序applicationIconBadgeNumber.例如在应用程序didReceiveLocalNotification中.

You need to set the application applicationIconBadgeNumber. For example in the application didReceiveLocalNotification.

- (void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notif {
    application.applicationIconBadgeNumber = notif.applicationIconBadgeNumber-1;
}

这篇关于如何从LocalNotification删除取消的ApplicationIconBadgeNumber?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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