如何增加重复本地通知的应用程序徽章编号(iPhone) [英] How to increment application badge number for recurring local notification (iPhone)

查看:91
本文介绍了如何增加重复本地通知的应用程序徽章编号(iPhone)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经设置了每分钟重复的本地通知,但是我需要每次都增加应用程序徽章编号。当我运行它的时候它似乎没有增加,它只是保持1.请有人可以帮助我吗?

I've setup a local notification that repeats every minute, however I need the application badge number to increment each time. When I run it at the moment it doesn't seem to increase, it just stays a 1. Please can someone help me out?

以下是我创建通知的方法:

Here is how I create the notifications:

// Create the UILocalNotification
UILocalNotification *myNotification = [[UILocalNotification alloc] init];
myNotification.alertBody = @"Blah blah blah...";
myNotification.alertAction = @"Blah";
myNotification.soundName = UILocalNotificationDefaultSoundName;
myNotification.applicationIconBadgeNumber++;
myNotification.timeZone = [NSTimeZone defaultTimeZone];
myNotification.repeatInterval = NSMinuteCalendarUnit;
myNotification.fireDate = [[NSDate date] dateByAddingTimeInterval:30];
[[UIApplication sharedApplication] scheduleLocalNotification:myNotification];


推荐答案

经过大量的研究后,我发现解决方案是没有解决方案:

After doing lot's of research I figured out the solution is that there is no solution:

iPhone:通过本地通知增加应用程序徽章

无法动态更新徽章编号您的应用在后台时的本地通知。您必须使用推送通知。

这篇关于如何增加重复本地通知的应用程序徽章编号(iPhone)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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