【发布时间】:2016-08-15 18:58:58
【问题描述】:
我正在创建简单的UILocalNotification,没有调度,只是从后台使用以下代码:
let n = UILocalNotification()
n.alertBody = "\(nam) \(wat)"
n.userInfo = ["id": id, "t":type.rawValue]
n.soundName = UILocalNotificationDefaultSoundName
n.category = "call_chat"
app.scheduleLocalNotification(n)
我在里面打印userInfo
func application(_ application: UIApplication, didReceive notification: UILocalNotification)
直到这里一切都很好。但是我需要稍后关闭一些具有相同 id 的通知并创建新通知。当我尝试使用UIApplication.shared.scheduledLocalNotifications 获取它们时,它们在iOS9 中都有userInfo==nil,在iOS10 beta 中具有userInfo==["":""]。
【问题讨论】:
标签: ios uilocalnotification swift3