解析推送通知添加新动作

时间:2016-02-02 08:18:04

标签: ios swift push-notification uialertcontroller

如果我的应用程序已打开且我收到推送通知,则警报只有一个操作 - “确定”。是否可以添加另一个动作,类似于我如何为UIAlertController执行如下操作?

let alert = UIAlertController(title: title, message: message, preferredStyle: UIAlertControllerStyle.Alert)
alert.addAction(UIAlertAction(title: "Second Action", style: .Default, handler: { (action) -> Void in
    }))

更新:我一直在环顾四周,看来你不能这样做

2 个答案:

答案 0 :(得分:0)

您可以在Appdelegate.m

中执行任何操作
- application: didReceiveRemoteNotification:

只需在此处实施您的代码。

答案 1 :(得分:0)

[PFPush handlePush:userInfo];中评论此- application: didReceiveRemoteNotification:方法,并提供问题中提到的自定义提醒视图。