Ios 设备重新启动时的本地通知

Ios 设备重新启动时的本地通知,ios,swift,uilocalnotification,Ios,Swift,Uilocalnotification,我有一个iOS应用程序,大约每4小时触发一次本地通知。这似乎是成功的预期工作。不过,我关心的是,如果用户重新启动设备,该怎么办。是否仍存在任何现有的本地通知?以下是我触发本地通知的方式: var localNotification:UILocalNotification = UILocalNotification() localNotification.alertAction = "report_alarm" localNotification.alertBody = "

我有一个iOS应用程序,大约每4小时触发一次本地通知。这似乎是成功的预期工作。不过,我关心的是,如果用户重新启动设备,该怎么办。是否仍存在任何现有的本地通知?以下是我触发本地通知的方式:

    var localNotification:UILocalNotification = UILocalNotification()
    localNotification.alertAction = "report_alarm"
    localNotification.alertBody = "Please file report"
    localNotification.fireDate = NSDate(timeIntervalSinceNow: 4 * 60 * 60)
    localNotification.soundName = UILocalNotificationDefaultSoundName
    UIApplication.sharedApplication().scheduleLocalNotification(localNotification)

如果用户在4小时内重新启动设备,是否仍会触发本地通知?如果没有,是否有任何方法可以在设备完成重新启动时通知我的应用程序,并且我可以设置必要的本地通知?谢谢你的帮助

重新启动后通知将消失。(顺便说一句,这很容易测试。)

当应用程序以
ui应用程序启动时,您可以检查活动通知
API:

UIApplication.sharedApplication().scheduledLocalNotifications

如果需要,您可以使用“通知”
userInfo
dictionary属性来识别它们。

这些可能会有帮助:使用本地通知的最新veriosn 0.9.0-beta.3时出现相同问题。