Xcode - Push Notification Json -
Xcode - Push Notification Json -
i send force notification app in json format containing custom data, don't know how extract info it, or if json format correct. ( think because parse sends successfully)
json parse:
{ "aps": { "badge": 1, "alert": "test", "sound": "" }, "url": "http://www.google.com" } appdelegate:
func application(application: uiapplication, didreceiveremotenotification userinfo: nsdictionary!) { var notificationpayload: nsdictionary = userinfo["url"] nsdictionary! if (notificationpayload["url"] != nil) { var url = notificationpayload["url"] string var feed: feedtableviewcontroller = navigation.viewcontrollers[0] feedtableviewcontroller feed.messages.append(url) feed.sections.append("url") }else { pfpush.handlepush(userinfo) } }
try instead:
func application(application: uiapplication, didreceiveremotenotification userinfo: nsdictionary!) { if allow url = userinfo["url"] as? string { var feed: feedtableviewcontroller = navigation.viewcontrollers[0] feedtableviewcontroller feed.messages.append(url) feed.sections.append("url") } else { pfpush.handlepush(userinfo) } } json xcode push-notification
Comments
Post a Comment