polycasts
polycasts copied to clipboard
[ep59-firebase-messaging] How to save tokens from multiple devices w/o overwriting?
https://github.com/Polymer/polycasts/blob/6e0ae5227bad9693f58f00152804adfca218c651/ep59-firebase-messaging/public/my-subscription.html#L27-L36
What if the user opens the web app and enable notifications on multiple devices? The token from one device will overwrite the token from another device. How to save tokens without overwriting to send push notifications to all devices?
@robdodson PTAL.
hm good question. I don't know enough about firebase to know what the best answer is. @michaelbleigh any ideas?
I think that the applicable logarithm is :
- Get Id from your application or device , this depends on your app (browser finger print , android device Id etc).
- Register token in path like :
users/token/userId/Unique_Id_Retrieved_in_Step_one.
the first step is challenging ; I think this is the best resource for android Id [https://stackoverflow.com/a/17625641/2390992](get Unique Id from android app) & this is the best resource for [https://stackoverflow.com/questions/4935964/javascript-unique-browser-id](getting unique Id from browser )