在我的应用程序中,我有触发本地通知的对象。
当应用程序在后台时,本地通知会在它们被触发的时候被触发,并且效果很好。
由于某种原因,徽章编号未更新。
在设置 Notification 对象时,我使用以下代码:
UILocalNotification* localNotification = [[UILocalNotification alloc] init];
localNotification.fireDate = obj.noteMeDate; //obj is an object for which the notification is created...
localNotification.alertBody = [NSString stringWithFormat:@"Note: %@", obj.title];
localNotification.alertAction = @"Show Me";
localNotification.timeZone = [NSTimeZone defaultTimeZone];
localNotification.soundName = UILocalNotificationDefaultSoundName;
localNotification.applicationIconBadgeNumber = [[UIApplication sharedApplication] applicationIconBadgeNumber] + 1; //this is NOT WORKING...
[[UIApplication sharedApplication] scheduleLocalNotification:localNotification];
任何人?