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

FCMDeviceAuthorizedViewSet allows duplicate registrations with same device ID and registration token #64

Closed
kz26 opened this issue May 27, 2018 · 1 comment

Comments

@kz26
Copy link
Contributor

kz26 commented May 27, 2018

I've hooked up FCMDeviceAuthorizedViewSet to Django REST framework using DefaultRouter as described in the manual, and configured my app to POST to my base URL /api/fcm/. Registration seems to be working nicely, except for the fact that the creation view by FCMDeviceAuthorizedViewSet seems to allow for the same device ID to be registered to the same user again, even if the registration token is identical.

The manual states "Will allow duplicate registration_id’s for different users, so you are responsible for cleanup (if that is generally perceived as undesired behaviour or if the package itself should be doing the cleanup, open an issue or email me)". It seems that the most logical behavior would be to allow one user to register multiple unique device IDs, and only update the registration_token for existing device IDs.

@kz26
Copy link
Contributor Author

kz26 commented May 28, 2018

I've come to the conclusion that this is a downstream side effect of #53. I've submitted a PR that addresses that issue as well as fixed a couple of logic errors that were causing everyone else's tokens to be set to inactive.

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

1 participant