Open subashdbc opened 5 years ago
Not sure what the context is, but ideally you could just update your subscription on db whenever a new one is issued. Do you really need to remove it from db ?
How do we know to which subscription it has to be updated in DB? Let's say I have logged in to the chrome on desktop and as well as logged in the mobile device, in this situation, we have stored 2 subscriptions right?
In this case, how can we know that it is from the mobile endpoint or chrome endpoint?
Correct me if I am wrong? for now, I store only Auth
, Endpoint
, P256DH
on DB.
Do we need to store user_id
or more_info also?
Please help me to clarify and guide me in the right way
Thanks in advance
If you have a user_id - i would say link your user_id to the push tokens - that way you could target notifications to a particular customer.
If you cant have a user_id - You can maybe store a unique id on the device storage itself and use that to update ur push tokens whenever they change.
Thanks for the reply :) I got some inputs now.
Just a question let's say if the same user connects
Thanks in advance!
Depends on what you are looking for/your requirements. If you want the push notification to go to all three devices you would store all of them if not just store the latest one.
Thanks for the suggestions :). If any I will reach out here
Hi, How do you remove the subscription details from the DB when Service worker being uninstalled? Can you suggest?