/push rest api gives me 500 error but the message gets through
Closed this issue · 0 comments
Can someone give me an example of how to send a push notification with Strongloop using the REST API?
What endpoint do I use? POST /push or POST /notifications?
Docs do not tell me what the difference is and when to use which.
When I send a test push notification using /push REST API I'm getting a 500 error.
http://localhost:3010/api/push
Response Body
{
"error": {
"name": "Error",
"status": 500,
"message": "Cannot configure push notifications - unknown application id \"MyLoopBackApp\"",
"details": {
"appId": "MyLoopBackApp"
},
"stack": "Error: Cannot configure push notifications - unknown application id \"MyLoopBackApp\"\n
}
}
Ironically, the push message actually works. So I don't understand the error. I assure you that MyLoopBackApp is not my app id. It's loopback-component-push-app The only place this text is on my computer is in some device-registration-test.js files that are for testing this component.
When I send a push notification using the /notifications API, I get a 200 success but the message never comes to my phone.
The notificaiton I'm sending is:
{"deviceType":["android"],"deviceToken":["APA91bGIiIpDdrJ797BvCjNjXPuZ4qKr_L2MjPjASDFWerYUiNB9AhvnjEQhWIHxAfRMa5nn9vUdlgbyMmnERS3asCtyDHbpElazIN66D9djRGWWH08FTBMwMXniuvmiKIhskVIPRQw"],"badge" : 5, "sound": "ping.aiff", "alert": "Hello World", "messageFrom": "Errfan"}