Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Push notifications not being received by android device #1577

Closed
miracle7 opened this issue Apr 21, 2016 · 5 comments
Closed

Push notifications not being received by android device #1577

miracle7 opened this issue Apr 21, 2016 · 5 comments

Comments

@miracle7
Copy link

I have managed to get push notifications working in a test app using Unity, Parse Server and Heroku, however when I try the same configuration in our actual game, the push notifications never come through.

I am running Parse Server 2.2.7 on Heroku with MongoDB, and the test app does not have anything that the main app is missing.

All other Parse functionality is working fine, even the installation is saved with a device token, however when I send a push notification if the device token was generated by the test app it works fine, but if it is using the token generated by our actual game I see this in the _PushStatus document in my DB, and it never gets through to the phone:

{
"_id": "uUrP5xF64W",
"pushTime": "2016-04-21T01:07:43.653Z",
"_created_at": {
"$date": "2016-04-21T01:07:43.653Z"
},
"query": "{}",
"payload": "{"alert":"Please work"}",
"source": "rest",
"status": "succeeded",
"numSent": 0,
"pushHash": "1c5dd358f9bd636feff13872764e096b",
"_wperm": [],
"_rperm": [],
"numFailed": 1,
"failedPerType": {
"android": 1
}

I can't figure out how to troubleshoot this, I need more than 'it failed for android' to try and debug this but I don't know where to look as there is nothing in the logs.

I tried going through this repo trying to figure out where 'numFailed' was incremented, and eventually dug all the way down to PushAdapter.js but had no luck finding any more information as to what determines whether the device token is valid or whatever is blocking it.

If I copy the device token from the test app to the install generated by the new app it all works fine as well, so it is definitely an issue with the way the device registers or the way the push notification is trying to be sent.

Would really appreciate any help on this as I am very stuck, just basically doing trial and error to see if stuff works at this point.

@miracle7
Copy link
Author

For some context on how I got to this point, you can take a look at the issue I opened here:
parse-community/Parse-SDK-dotNET#190

In short I got push notifications working for Parse.com, and they broke when I moved to parse server, though everything else kept working.

@flovilmart
Copy link
Contributor

Try running your server with VERBOSE=1 this will log the response from GCM.

@miracle7
Copy link
Author

I started with the parse server example on heroku, do you know how I would go about enabling verbose on there?

Sorry if this is a really basic question, I am very new to a lot of this stuff.

@drew-gross
Copy link
Contributor

One way is to run your Parse Server with the verbose option:

var myServer = ParseServer({
  verbose: true,
  ...otherOptions
});

@miracle7
Copy link
Author

Thank you, doing it like that didn't work, but I was able to enable it by putting this in my config variables in the heroku dashboard:
image

The response did say 'mismatched sender id' which allowed me to debug the application and find the problem:

We have another native java plugin in our app, but last time someone compiled that they accidentally bundled custom notification handler into it as well (which meant using old PARSE_GCM_SENDER_ID), which was being used instead of the new one I compiled.

In other words, my bad and thanks for your help :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants