Bad Addy
Posts: 0
Joined: Fri Dec 13, 2013 9:34 pm

Push Notification API Issue

This will send it to both iOS and Android ?

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Push Notification API Issue

yes

Bad Addy
Posts: 0
Joined: Fri Dec 13, 2013 9:34 pm

Push Notification API Issue

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 ?

Bad Addy
Posts: 0
Joined: Fri Dec 13, 2013 9:34 pm

Push Notification API Issue

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

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Push Notification API Issue

Working on it.

Bad Addy
Posts: 0
Joined: Fri Dec 13, 2013 9:34 pm

Push Notification API Issue

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

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Push Notification API Issue

Hi Addy,

Thank you for the update! Glad you fixed it!

Return to “Issues”