如何清除的iOS推送通知徽章计数? [英] How to clear push notification badge count in iOS?
问题描述
我要清除的推送通知徽章计算一次应用是launched.Im不清楚的地方设置C $ C.请下面的$给予简要说明有关清除徽章计数。
[UIApplication的sharedApplication] .applicationIconBadgeNumber = 0;
您应该将此 [UIApplication的sharedApplication] .applicationIconBadgeNumber = 0;
中
或者,如果应用程序启动并发送至后台,那么你推出 didFinishLaunchingWithOptions
方法将不会被调用,所以使用了上述两种方法的应用这些方法的AppDelegate
- (无效)applicationWillEnterForeground:(UIApplication的*)的应用
- (无效)applicationDidBecomeActive:(UIApplication的*)的应用
I want to clear the push notification badge count once app is launched.Im not clear where to set the below code.Please give brief description about clearing the badge count.
[UIApplication sharedApplication].applicationIconBadgeNumber = 0;
You should set this [UIApplication sharedApplication].applicationIconBadgeNumber = 0;
in
either of these AppDelegate methods if the application is launched and sent to background then you launch the application didFinishLaunchingWithOptions
method will not be called so use either of these methods
- (void)applicationWillEnterForeground:(UIApplication *)application
- (void)applicationDidBecomeActive:(UIApplication *)application
这篇关于如何清除的iOS推送通知徽章计数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!