Tru*_*an1 15 apple-push-notifications ios uilocalnotification ios8
我正在列出为我的本地通知按下的操作,但有没有办法确定用户何时解除通知?
这是我在AppDelegate中听我的动作的方式,但是解雇并没有解雇这个问题:
func application(application: UIApplication, handleActionWithIdentifier identifier: String?, forLocalNotification notification: UILocalNotification, completionHandler: () -> Void) {
var actionName: String? = nil
if let identifier = identifier {
switch identifier {
case "snoozeAction":
actionName = "snoozeActionTapped"
break
default: break
}
if let name = actionName {
NSNotificationCenter.defaultCenter().postNotificationName(name, object: nil)
}
}
completionHandler()
}
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
2223 次 |
最近记录: |