I want to present a particular viewcontroller when the user tap on a banner notification OR "OK" on the alertnotification. I am notified whenever the app receives a voip push notification with this method:
func pushRegistry(registry: PKPushRegistry!, didReceiveIncomingPushWithPayload payload: PKPushPayload!, forType type: String!) {
let data = payload.dictionaryPayload
let aps = data["aps"] as! [String: AnyObject]
let alert = aps["alert"] as! [String: AnyObject]
let notification = UILocalNotification()
//setup the notification
notification.alertBody = alert["body"] as? String
notification.alertTitle = alert["title"] as? String
notification.soundName = aps["sound"] as? String
notification.alertAction = alert["action-loc-key"] as! String
//show the notification
UIApplication.sharedApplication().presentLocalNotificationNow(notification)
How can i add an action to the tapping of the banner or the notification.alertAction ?