SupabaseS
Supabase3y ago
kgni

Push notifications - multiple devices, same account/user

Hi guys.

I want to implement push notifications, but potentially for multiple devices that are logged into the same account.

I'm using expo-notifications and for 1 device I would probably just create a column and store the notification token directly in my user table - but for multiple I'm not sure.

Would it just be as simple as creating another table, "tokens" and relate that to the users table?

Also one thought I had was, that I would probably not want to store notification tokens that hasn't been used for x-amount of time (not sure if it is even needed to control this) - but in that case I would need a table for device info as well I assume (to know if a device that has a token attached to it is inactive).

Anyone of you who has implemented something similar before?

Thanks in advance!
Was this page helpful?