Support for Critical Alert
Closed this issue · 4 comments
Just wondering if there is support for sending critical alerts. Basically this makes the sound key a dictionary instead of a string. Currently it appears the class doesn't support it. Below is a sample payload for sending critical push notifications.
{ "aps": { "content-available": 1, "sound": { "critical": 1, "name": "sound", "volume": 1.0 }, "badge": "Increment", "alert": { "title": "Test", "body": "Test" }, "county": "Test" } }
If you want support for this, you have to head over to https://github.com/node-apn/node-apn module.
This adapter just passes the payload to the module.
Check out the Notification Documentation
It should support this from a quick glance.
Edit: It looks like somebody beat you to it. node-apn/node-apn#646
You have to wait for that PR to be submitted and released
Hi @dplewis, Thanks for the quick response. How could this be used with parse-server? I am currently pushing from a python script. Please see below.
def sendPush():
connection = httplib.HTTPSConnection('yourserver', 443)
connection.connect()
connection.request('POST', "/parse/push", json.dumps({
"where": {
"channels": channel,
},
"data": {
"content-available": 1,
"sound": {
"critical": 1,
"name": "sound",
"volume": 1.0
},
"badge": "Increment",
"alert": {
"title": title,
"body": message
},
}
}), {
"X-Parse-Application-Id": appID,
"X-Parse-Master-key": masterKey,
"Content-Type": "application/json"
})
result = json.loads(connection.getresponse().read())`
Could you please post this over on Stack Overflow with the parse-platform
tag.
We are trying to keep GitHub issues reserved for bug reports & feature requests - see the section on help and communication on our website.