Page 2 of 2

Push Notification API Issue

Posted: Thu Feb 13, 2014 1:42 pm
by Bad Addy

This will send it to both iOS and Android ?


Push Notification API Issue

Posted: Thu Feb 13, 2014 1:49 pm
by Maryna Brodina

yes


Push Notification API Issue

Posted: Fri Feb 14, 2014 5:26 pm
by Bad Addy

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:

Image

Image

{"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 ?


Push Notification API Issue

Posted: Fri Feb 14, 2014 6:05 pm
by Bad Addy

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!!


Push Notification API Issue

Posted: Fri Feb 14, 2014 6:21 pm
by Kateryna Grynko

Working on it.


Push Notification API Issue

Posted: Fri Feb 14, 2014 7:15 pm
by Bad Addy

Fixed this issue now:

precode
$.ajax({
type: 'POST',
dataType: 'json',
contentType: 'json',
beforeSend: function(request) {
request&#46;setRequestHeader('X-Appery-Push-API-Key', '<KEY>');
request&#46;setRequestHeader('Content-Type', 'application/json');
},
url: 'https:&#47;&#47;api&#46;appery&#46;io/rest/push/msg',
data: '{"payload":{"message" : "'+message+'", "badge" : 0}, "status": "sent", "filter" : {"lc" : "'+ sname +'"}}',
success: function(res) {
console&#46;log(res);
},
error: function(xhr, ajaxOptions, thrownError) {
console&#46;log("Load error: " + xhr&#46;status + " " + xhr&#46;responseText);
}
});
/code/pre


Push Notification API Issue

Posted: Fri Feb 14, 2014 7:31 pm
by Kateryna Grynko

Hi Addy,

Thank you for the update! Glad you fixed it!