0
votes

my Android app requirement is to assign old (already exists UID) UID to new users while signing in with Google so that the new user can access the old user data directly. Note: old user data is stored with UID as the node but in various Firebase Realtime Database top-level nodes. Is it possible to change the UID.

2

2 Answers

1
votes

There is no way to assign a UID to a user that is created with a client-side SDK, as that would be a major security risk. After all: what is keeping other users then also claiming the UID of any other user in your app.

The typical way is to deal with a scenario like this is to either track who has access to whose data in the database, or to perform a data migration when the new user is created and you've validated that they're indeed supposed to "inherit" another user account's data.

0
votes

You can use link method from firebase SDK. see here