I am using platform.api.get access a Remote Web Service, which works fine.
The remote web-service is basically a simple PHP script which I use to send notifications.
I need to send the message and device token to the webservice as parameter, so I was wondering how to do that.
If I put the entire external URL in the get( ), I send it as query string with the URL, which works fine. But, I was interested to know how to send the params when using the remote webservice, which I can set in the DSP.
The below does NOT give me device and message in the php file.
var result = platform.api.get(“iosnotification”,{“device”:“64049f56abe454a1ab0ab0bac00673d659a50***0f0c2b6289a7f0",“message”:“Hello and Hi”});
OR
var payload = {“device”:"64049f56abe454a1ab0ab0b927ea10f0c2b6289a7f0”,“message”:“Hello and Hi”};
var result = platform.api.get(“iosnotification”,JSON.stringify(payload));
Whereas, the one below with external URL does:-
var result= platform.api.get(“http://ec2-54---23.ap-southeast-1.compute.amazonaws.com/bitnami/simplepush.php?device=64049f56abe454a1ab0a**********5437927ea10f0c2b6289a7f0&message=Hellos+We+ALL+Are+HEre”);
I access them in PHP Script like this:- deviceToken=_GET[“device”]; message = _GET[“message”];
We have identified that this functionality is not currently present, and are evaluating ways to add it as an enhancement to the next release. You’re correct that “Add More Parameters” is only valid for constant values.