I want to send an actionable Push Notification(a Notification with a button) from the WebApp through Javascript API. That is I expect the payload to be received on the iOS device as below:
“aps” : {
“alert” : “Pull down to interact.”,
“category” : “ACTIONABLE”
}
I tried setting the category in the publish header options, but that prepares the payload like this:
“aps” : {
“alert” : “Pull down to interact.”,
}“category” : “ACTIONABLE”
which is not what I expect.
So please let me know how to frame the message below in the below API, so that I will end with the Fisrt Payload.
var channel = “default”,
message = “Pull down to interact”,
pubOps = null,
deliveryOps = new DeliveryOptions({
pushPolicy: “PUSHONLY”
});
var response = Backendless.Messaging.publish( channel, message, pubOps, deliveryOps );
I think there is a misunderstanding. I didn’t frame the payload and it is done by the SDK.
If my JS is,
var channel = “default”,
message = '“Pull down to interact.”,
pubOps = null,
deliveryOps = new DeliveryOptions({
pushPolicy: “PUSHONLY”
});
var response = Backendless.Messaging.publish( channel, message, pubOps, deliveryOps );
it prepares the payload like this.
“aps” : {
“alert” : “Pull down to interact.”
}
So to get the payload as,
“aps” : {
“alert” : “Pull down to interact.”,
“category” : “ACTIONABLE”
}
what should be the JavaScript change that needs to be done from the above? Hope this is clear.
Regards,
Balakrishnan
Thanks for checking. Just to make sure we’re reproducing the problem correctly, how do you subscribe to receive the notification? Where exactly do you check the value of the received object?
Does this also cover loc-key which is used in iOS to send localised alert text (localisation controlled by the app instead of the server needing to know all localisations)?
The dev team has reported to me that ios-category works when you run an app on iOS-9. However, with the changes in iOS10, it arrives, but is not visualized properly. We’re investigating that issue.