我正在尝试使用 Malcom API 在推送通知中发送自定义参数,但我无法从我的 iOS 应用程序中读取它们。
卷曲示例:
curl -u user:pass -H "Content-Type: application/json" -X POST -d '{ "notification": { "applicationCode": "appUDID", "environment": "SANDBOX", "message": "Message", "udids": [ "00c93096526860d932ba1bf116e752b8f2689675" ], "notificationCustomization": { "customfield": [ {"entry": { "key":"new_id", "value": "25" }} ], "badge": 5 } } }' http://api.mymalcom.com/v3/notification/push
iOS 代码(AppDelegate):
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo {
[MalcomLib didReceiveRemoteNotification:userInfo active:[MalcomLib getAppActive]];
}
userInfo 包含以下信息:
{
aps = {
alert = "Message";
badge = 5;
};
notificationId = 521726;
}
你知道我在哪里可以读取这些参数吗?