【发布时间】:2015-07-13 09:34:14
【问题描述】:
在几分钟内,我同时收到了两个不同的本地通知。 但是应用程序的徽章编号显示“1”而不是“2”
我的代码:
var localNotification = UILocalNotification()
localNotification.userInfo = ["UUID": FirstReminderString, ]
localNotification.fireDate = SameDay
localNotification.alertBody = "Reminder !"
localNotification.timeZone = NSTimeZone.defaultTimeZone()
localNotification.applicationIconBadgeNumber = UIApplication.sharedApplication().applicationIconBadgeNumber + 1
UIApplication.sharedApplication().scheduleLocalNotification(localNotification)
【问题讨论】:
-
您可能会在this related question 中找到有用的附加信息。
-
好的,这意味着在注册新通知之前,我必须检查同一天有多少通知处于活动状态,并为新通知获取此计数 + 1?我如何查看一天的通知数量?
标签: swift notifications numbers locale badge