Description
- You've met the prerequisites.
- You're running the latest version of Parse Server.
- You've searched through existing issues. Chances are that your issue has been reported or resolved before.
Parse Server Environment Setup
Node.JS 4.4
Python 2.7.11
Parse Server 2.2.2
Self hosted MongoDB 3.0.10-1.5 (Storage engine: Rocksdb)
Debian 8
Description of issue
Currently we having an issue with push notifications sent from Parse Server cloud code. Sending out push notifications does not work and the Parse.com dashboard starts showing issues when _PushStatus entries created by parse-server are present in the database.
While migrating to our own Parse Server we are still sending Push notifications from our hosted Parse.com Cloud Code environment. This still works fine even with a self-hosted MongoDB instance.
The first issue encountered in Parse Server is that push notifications aren't being sent out properly. The status of the push is stuck on Running with 0 pushes being sent out (on an audience of about 800-1000 pushes).
The second issue is that once a _PushStatus entry is created by Parse Server, the Parse.com hosted dashboard doesn't list any push entries on the push tab anymore. It just shows a message "No pushes to display yet. You may need to configure push notifications for your app." until all _PushStatus entries created by Parse Server are removed from the database (or end up on the second page of the push list, therefore allowing the first page to load properly again).
The Parse.com hosted code and our Parse Server code calling Parse.Push.send() is identical. Both environment use the same connection string to query and manipulate the self hosted MongoDB instance. Both environments also use the same apn push certificates/gcm sender ids
Logs/trace
Here is an example of a _PushStatus entry sent from Parse.com hosted cloud code that succeeded:
{
"_id" : "BfDvKA6DJQ",
"_created_at" : ISODate("2016-03-29T07:24:59.780Z"),
"_updated_at" : ISODate("2016-03-29T07:25:01.785Z"),
"source" : "cloud_code",
"query" : "{\"channels\":{\"$in\":[\"News\",\"all\"]}}",
"payload" : "{\"alert\":\"OMITTED \",\"badge\":\"Increment\",\"title\":\"OMITTED\",\"uri\":\"OMITTED\"}",
"status" : "succeeded",
"numSent" : 866,
"pushHash" : "05e34d28cccd81d0d42456a4224863e7",
"expansionDuration" : 0.677969696,
"sentPerType" : {
"embedded" : 0,
"winphone" : 0,
"js" : 0,
"winrt" : 1,
"android" : 522,
"ios" : 343,
"osx" : 0
}
}
And here is a _PushStatus entry sent from Parse Server Cloud Code that failed (stuck on "running" status).
{
"_id" : ObjectId("56fa2e992121357c31f1e72f"),
"objectId" : "8Rnbtvti14",
"pushTime" : "2016-03-29T07:28:25.966Z",
"_created_at" : ISODate("2016-03-29T07:28:25.966Z"),
"query" : "{\"channels\":{\"$in\":\"news\",\"all\"]}}",
"payload" : {
"alert" : "*OMITTED*",
"badge" : "Increment",
"title" : "*OMITTED*",
"uri" : "*OMITTED*"
},
"source" : "rest",
"title" : null,
"expiry" : null,
"status" : "running",
"numSent" : 0,
"pushHash" : "14f5359b3cc94f0f463fd5403a52a5da",
"_wperm" : [],
"_rperm" : []
}