In my app, user can login as guest user. I want to authenticate the guest user with email & password, or with google. The user id should remain the same after authentication. How to do that?
To upgrade an anonymous account to an account with credentials, you create a new account with the sign-in method that you want to use, and then link the anonymous account and that new account together as shown in the Firebase documentation.
So in Flutter you'd use the relevant auth provider's getCredential method (e.g. Facebook or Google) and then call linkWithCredential on the anonymous user object.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With