0

I'm integrating firebase to my react app and need to generate a unique id for the app with purposes to identify user by this id in the future. After reading firebase docs found that there exist instanceId methods to generate a unique token for iOS and Android.

Question is, are there exist similar methods for generating instanseId for web apps? If no, what methods/packages are you using for these purposes?

I have experience with this npm package device-uuid, but maybe you know another best way to do so.

Dastan Kumar
  • 73
  • 1
  • 7
  • Don't you get it from firebase itself? Why you need to generate by yourself? https://stackoverflow.com/a/28822372/863110. Also, if you just want to generate guid, https://stackoverflow.com/a/2117523/863110 – Mosh Feu Mar 03 '20 at 11:21
  • Hey, thanks for your comment. As I said in a question I need a unique id for PWA instance that will be stable and I could identify a user using this id in the future. GUID is not stable because every time it returns a new value. – Dastan Kumar Mar 03 '20 at 11:33
  • 1
    So when you say `identify user` it's not actually the user but the device.. – Mosh Feu Mar 03 '20 at 11:46
  • That's right! Sorry for the inexactness. – Dastan Kumar Mar 03 '20 at 11:57
  • I can offer to generate guid and store it in `localStorage`. It will not be consistent if the user will clear the site's data though. – Mosh Feu Mar 03 '20 at 12:47

0 Answers0