【发布时间】:2014-12-04 20:09:23
【问题描述】:
我想以包含自定义数据的 Json 格式向我的应用发送推送通知,但我不知道如何从中提取数据,或者我的 json 格式是否正确。 (我认为是因为 Parse 发送成功)
来自 Parse 的 JSON:
{
"aps": {
"badge": 1,
"alert": "Test",
"sound": ""
},
"url": "http://www.google.com"
}
应用代理:
func application(application: UIApplication, didReceiveRemoteNotification userInfo: NSDictionary!) {
var notificationPayload: NSDictionary = userInfo["url"] as NSDictionary!
if (notificationPayload["url"] != nil) {
var url = notificationPayload["url"] as String
var feed: FeedTableViewController = navigation.viewControllers[0] as FeedTableViewController
feed.messages.append(url)
feed.sections.append("url")
}else {
PFPush.handlePush(userInfo)
}
}
【问题讨论】:
标签: json xcode push-notification