This will send it to both iOS and Android ?
This will send it to both iOS and Android ?
I have tested the above and still getting the same error
precode
url: 'https://api.appery.io/rest/push/msg',
data: '{"payload":{"message" : "'+message+'", "badge" : 0}, "status": "sent", "filter" : {"'+type+'" : "'+ sname +'"}}',
success: function(res) {
console.log(res);
/code/pre
This is the response, and how it looks in dev screen on the browser:
{"payload":{"message" : "You have a question in your area", "badge" : 0}, "status": "sent", "filter" : {"lc" : "Frampton Cotterell"}}
Its a syntax, so I don't know whats in the wrong place ?
I have tried a number of variations of this, and each time I get the same error, rather than different ones, which is a syntax error.
Really need help!!
Working on it.
Fixed this issue now:
precode
$.ajax({
type: 'POST',
dataType: 'json',
contentType: 'json',
beforeSend: function(request) {
request.setRequestHeader('X-Appery-Push-API-Key', '<KEY>');
request.setRequestHeader('Content-Type', 'application/json');
},
url: 'https://api.appery.io/rest/push/msg',
data: '{"payload":{"message" : "'+message+'", "badge" : 0}, "status": "sent", "filter" : {"lc" : "'+ sname +'"}}',
success: function(res) {
console.log(res);
},
error: function(xhr, ajaxOptions, thrownError) {
console.log("Load error: " + xhr.status + " " + xhr.responseText);
}
});
/code/pre
Hi Addy,
Thank you for the update! Glad you fixed it!