I have a Parse-Server (hosted by heroku) that I configured to send push notifications. It displays correctly on the control panel, but when I actually send it, it just says that clicking "Saved", but when I go to check its status, it could not send. Here is the index.js index for customization:
var api = new ParseServer({
databaseURI: databaseUri || 'mongodb://localhost:27017/dev',
cloud: process.env.CLOUD_CODE_MAIN || __dirname + '/cloud/main.js',
appId: process.env.APP_ID || 'myAppId',
masterKey: process.env.MASTER_KEY || '',
serverURL: process.env.SERVER_URL || 'http://localhost:1337/parse',
liveQuery: {
classNames: ["Posts", "Comments"]
},
push: JSON.parse(process.env.SERVER_PUSH || "{}"),
});
PARSE_SERVER_PUSH
(as well as appId, masterKey and serverURL) is configured in my configuration vars on heroku site as follows:
{ "ios":
{ "pfx": "/Users/path/to/folder/Prod\Cert.p12 ",
"passphrase": "******",
"bundleId": "com.parse.app",
"production": true
}
}
I'm not sure why the dashboard has a server configured to send push notifications correctly, but all of them do not work?
Edit: I also tried sending push through an API request as follows:
curl -X POST \
-H "X-Parse-Application-Id: myAppsID" \
-H "X-Parse-Master-Key: ***************" \
-H "Content-Type: application/json" \
-d '{
"where": {
"deviceType": { "$in": [ "ios", "android" ] }
},
"data": {
"title": "Ant-man",
"alert": "This is awesome. It is awesome."
}
}' \
https://appName.herokuapp.com/parse/push
{ "result": true} , , .
Edit2: , , , , , "Everyone". , - .