Send push notifications using the Malcom API with custom parameters

I am trying to send user settings to push notifications using the Malcom API, but I cannot read them from an iOS application.

CURL example:

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 Code (AppDelegate):

 - (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo { [MalcomLib didReceiveRemoteNotification:userInfo active:[MalcomLib getAppActive]]; } 

userInfo contains this information:

 { aps = { alert = "Message"; badge = 5; }; notificationId = 521726; } 

Do you know where I can read these parameters?

+4
source share
1 answer

I believe your JSON is not good enough. It should be like this:

 { "notification":{ "applicationCode":"yourApplicationCode", "environment":"SANDBOX", "message":"YourMessage", "notificationCustomization":{ "customFields":{ "entry":[ { "key":"yourkey1", "value":"yourvalue1" }, { "key":"yourkey2", "value":"yourvalue2" }, { "key":"yourkey3", "value":"yourvalue3" } ] } } 

}}

Hope this helps.

+4
source

All Articles