The*_*imp 7 iphone uilocalnotification
我已经设置了每分钟重复的本地通知,但是我需要每次都增加应用程序徽章编号.当我运行它的时候它似乎没有增加,它只是保持1.请有人帮助我吗?
以下是我创建通知的方法:
// 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];
Run Code Online (Sandbox Code Playgroud)
d.e*_*nis 21
经过大量研究后,我发现解决方案是没有解决方案:
当您的应用在后台时,无法使用本地通知动态更新徽章编号.您必须使用推送通知.
| 归档时间: |
|
| 查看次数: |
15885 次 |
| 最近记录: |