IOS push消息的数字不减少的问题

来源:互联网 发布:mac文件夹重命名命令 编辑:程序博客网 时间:2024/05/17 01:28

IOS push消息的数字不减少的问题,在做这个问题的时候。发现设置数字为0不能用,这时这个设置为0是写在应用程序加载的函数里面。只有双击Home键出现减号的时候删掉运行才会数字清零。

因此我把这个清零的数字写在

- (void)applicationDidEnterBackground:(UIApplication *)application
{
    // Clear application badge when app launches
    application.applicationIconBadgeNumber = 0;
    /*
     Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 
     If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
     */
    NSLog(@"c");
}

0 0
原创粉丝点击