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

Popular posts from this blog

php - How to pass multiple values from url -

xslt - DocBook 5 to PDF transform failing with error: "fo:flow" is missing child elements. Required content model: marker* -

database - php search bar when I press submit with nothing in the search bar it shows all the data -