-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Clean up invalid deviceTokens - deleting valid ones as well? #4500
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
Comments
I had a similar issue, please see this post |
@adammlevy Thanks. So the solution is removing the clean-up flag? And the ones who
have lost their deviceToken already need to re-install?
|
@oyvindvol in iOS, usually you can reaquire the device token easily, by registering again for pysh notifications, it is actually recommended to call the registration method on startup to make sure the token is valid. |
@flovilmart Yes, I am calling it on startup. That’s why I found it strange that the
affected installations did not get a new deviceToken on startup. They remain undefined..
|
@flovilmart I am testing this now:
Am I doing something wrong here? Edit:
I have copied the Would this be harmful in any way? Edit 2:
|
@oyvindvol why did you close the ticket? Have you found a solution? |
@halvini I got my deviceTokens back when:
|
@oyvindvol , oh, I managed to get my back from MongoDB backup. But did you find a solution for removing the Bad Device Tokens? |
@halvini No. |
I know this is an older thread, but I noticed that the FCM server returns a "NotRegistered" error when sending a push to a device in Do Not Disturb mode. I haven't looked at the parse push code, but if this error results in removing the deviceToken, and you only call register on startup, your app would not receive pushes after DND is turned off on the device. Also, I think the requirement to call fetch() on the current installation is because the server is removing something (deviceToken) out from under the clients, so the client caches still have a deviceToken and are not marked dirty, so they do not update the server record. This seems messy. |
@chrisbyers I haven't seen this mentioned in Google Android docs or anywhere else for that matter. It seems pretty counter-intuitive too. Do you have any reference for that? |
Issue Description
I have set the flag
PARSE_SERVER_CLEANUP_INVALID_INSTALLATIONS = 1
on Heroku. On some occations my users are reporting that push have stopped working, and when I check their Installation object, the deviceToken isundefined
. It has worked for them before.Is it possible that the clean up flag is also un-setting valid deviceTokens, on some occations?
What happens if I don`t set the flag, will the push sending abort when reaching an invalid deviceToken? Or will it just log, and continue sending pushes to valid ones?
Steps to reproduce
Set up environment with versions as described below. Set the flag
PARSE_SERVER_CLEANUP_INVALID_INSTALLATIONS=1
on Heroku. Use parse-server for a while, and see that some installation objects may getdeviceToken=undefined
after some time.Expected Results
Valid deviceTokens are not un-set.
Actual Outcome
Valid deviceTokens may get un-set.
Environment Setup
Server
Database
The text was updated successfully, but these errors were encountered: