【发布时间】:2014-11-30 20:55:36
【问题描述】:
我有一个 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 小时内重启设备,还会触发本地通知吗?如果没有,有什么方法可以在设备完成重启时通知我的应用程序并且我可以设置必要的本地通知?感谢您的帮助!
【问题讨论】:
-
使用本地通知的最新版本 0.9.0-beta.3 时遇到同样的问题。
标签: ios swift uilocalnotification