It seems that our initial plan to allow for multiple users on the same device was misguided. iOS does not allow our app the degree of flexibility in handling messages and choosing to show or not show notifications that we expected from reading the Firebase documentation, and so we need to be more selective in what we send. More importantly, as the app does not support multiple users at this time, it can lead to the app receiving and displaying notifications for a user who is not signed in.
This was partially addressed in #36, by having the back-end call the new delete token endpoint on logout. @v-rusu pointed out in #38 that the delete endpoint cannot address all cases; we need to enforce uniqueness throughout. This includes:
- Delete any current duplicates
- Replace the primary key on
devices to be only on (device_token)
- Update the conflict handler
- Add an
updated_at column to add some visibility into when the device token was reassigned or last used.
It seems that our initial plan to allow for multiple users on the same device was misguided. iOS does not allow our app the degree of flexibility in handling messages and choosing to show or not show notifications that we expected from reading the Firebase documentation, and so we need to be more selective in what we send. More importantly, as the app does not support multiple users at this time, it can lead to the app receiving and displaying notifications for a user who is not signed in.
This was partially addressed in #36, by having the back-end call the new delete token endpoint on logout. @v-rusu pointed out in #38 that the delete endpoint cannot address all cases; we need to enforce uniqueness throughout. This includes:
devicesto be only on(device_token)updated_atcolumn to add some visibility into when the device token was reassigned or last used.