We're in the process of setting up push notifications for our app and have found out that we'll run into a couple issues if we store the users device token in the users table.
- The user will only be able to receive push notifs on the one device (they could be logged in multiple)
Our users table:
| id (user pk) | ... other fields | device_token (for push notifs) |
The other 2 solutions would be to:
- Store a JSON array in the users table
- Create a second table called user_devicetokens & link the user_id & device_token + any other settings which may be helpful.
I'm wondering how others do this & whether these solutions can be improved in any way?