已安排本地通知但未触发

时间:2017-08-23 15:03:56

标签: ios nsdate nsdateformatter uilocalnotification swift2.3

当以UTC格式设置时间ia时触发时不发射本地通知

2017-08-23 20:23:27 +0000 // time to fire local notification

func schedule_Local_notification(alert_body: String, alertDate: NSDate) {
    let notification = UILocalNotification()
    notification.timeZone = NSTimeZone.systemTimeZone()
    print("local notication scheduled at \(alertDate)")
    notification.fireDate = alertDate
    notification.alertBody = alert_body
    notification.soundName = UILocalNotificationDefaultSoundName
    UIApplication.sharedApplication().scheduleLocalNotification(notification)
}

上述功能会打印在2017-08-23 20:23:27 + 0000'

上安排的本地通知值

任何人都可以帮助解决此问题

0 个答案:

没有答案