Is Firebase UID unique across multiple apps?

本秂侑毒 提交于 2019-12-11 02:36:00

问题


I have two different app which connects to same backend server and part of a same applications but different user. Say just like Uber Driver App and Uber User App.

  • Will the UID of a user will be same across different apps or is it limited to a single Firebase Project or single App?
  • I would also like to know, will it cause any harm to use Firebase UID as ObjectId in Mongo?

回答1:


As I just responded to your comment here:

UIDs are definitely be unique within a single project (so also across all apps in that project). I think they're also unique across all projects, but I've never had a need to investigate that.

Given that Firebase uses the UIDs to identify users, it sounds reasonable to use them to identify objects in Mongo.




回答2:


User's unique ID (uid) is only guaranteed to be unique across all providers in single app. If you want to mix uids from several apps you can add a prefix to uid, which will be unique to each app.

e.g. with uid: SamPLeUid12345 which might be repeated across several apps, you can store:
app1 uid: app1-SamPLeUid12345
app2 uid: app2-SamPLeUid12345




回答3:


UIDs are unique within a single project. Even accross different apps if they use the same project.

But according to the firebase blog, the uids will be different accross projects. If you use different projects on different apps, uids will be different.

The Firebase user IDs on each project will be different.

https://firebase.googleblog.com/2016/12/working-with-multiple-firebase-projects-in-an-android-app.html



来源:https://stackoverflow.com/questions/39992584/is-firebase-uid-unique-across-multiple-apps

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!