didFinishLaunchingWithOptions method
let notificationSettings = UIUserNotificationSettings(
forTypes: [.Alert, .Badge, .Sound], categories: nil)
UIApplication.sharedApplication()
.registerUserNotificationSettings(notificationSettings)
在sharedClass中
let localNotification = UILocalNotification()
localNotification.timeZone = NSTimeZone.localTimeZone()
localNotification.fireDate = getNextDate(NSDate(), duration: "5")
localNotification.alertBody = "Temp"
localNotification.alertAction = "OK"
UIApplication.sharedApplication()
.scheduleLocalNotification(localNotification)
我能够进入前景,但无法进入后台。有人对此有所了解吗?