Firebase + Flutter : get platform user used to sign in

Karel Debedts

I have an app with 3 sign in methods: Google, Facebook & mail. I want to show the users that are signed in with mail a different screen. Is it possible to get the sign in method form the package firebase authentication?

I know I can fix this by using firestore & checking if a statement is true or false. But that will cost me a read every time a user opens the app...

Gazihan Alankus

This seems to be what you want: https://firebase.google.com/docs/reference/android/com/google/firebase/auth/FirebaseUser.html#getProviderData()

In my app where I use Google logins only, I have firebaseUser.providerData[1].providerId == 'google.com'.

Btw, firebaseUser.providerData[0].providerId == 'firebase'.

I guess you could check them all and look for what providers you get for different kinds of users.

Edit: here's what I get when logging in with e-mail: https://postimg.cc/BXWGGN6h

この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。

侵害の場合は、連絡してください[email protected]

編集
0

コメントを追加

0

関連記事

分類Dev

Flutter Firebase Auth / Google_sign_in fail to login with statuscode=CANCELED

分類Dev

How to determine if the user signed in to Firebase with email and password or with google sign in?

分類Dev

Flutter app crashes on firebase phone auth in iOS platform

分類Dev

Flutter app crashes on firebase phone auth in iOS platform

分類Dev

Flutter Firebase - How to Add User uid to Document

分類Dev

Firebase Auth Get User Country

分類Dev

Did anyone manage to get the id token from google sign in (Flutter)

分類Dev

How to get current user address from firebase

分類Dev

Firebase Firestore get user related data

分類Dev

Get score and Category for specific user from Firebase

分類Dev

Check if the Firebase user is authenticated for the first time using google in Flutter

分類Dev

Get IP Address used to connect to Firebase from Android device

分類Dev

Flutter Firebase Auth / Google_sign_inがstatuscode = CANCELEDでログインに失敗する

分類Dev

Flutter how to get firebase dynamic link if app is already running?

分類Dev

Flutter Web Firebase - Get collection by sub-collection field

分類Dev

Flutter: How to get the GitHub master version of a firebase plugin

分類Dev

Sign "+" is not get inside ajax

分類Dev

PHP new user automatic sign in

分類Dev

Xamarin Android Firebase user: how to get created date

分類Dev

Flutter - Android Native Platform Integration

分類Dev

for what purpose # (hash) sign is used in Joomla?

分類Dev

test if a specific key was used to sign an .apk file

分類Dev

Flutter Firebase authentication - unlinking authentication provider does not result in the original (anonymous) user

分類Dev

How can I display on a widget the current user data from Firebase to Flutter

分類Dev

Flutter FireBase google signで、指定したコードの永続性記号を維持する方法

分類Dev

Get number before the percent sign

分類Dev

Firebase and new Google Sign-In on Android

分類Dev

How to properly sign out of Facebook on Android with Firebase?

分類Dev

Firebase Auth Ui Google Sign In "Developer Error"

Related 関連記事

  1. 1

    Flutter Firebase Auth / Google_sign_in fail to login with statuscode=CANCELED

  2. 2

    How to determine if the user signed in to Firebase with email and password or with google sign in?

  3. 3

    Flutter app crashes on firebase phone auth in iOS platform

  4. 4

    Flutter app crashes on firebase phone auth in iOS platform

  5. 5

    Flutter Firebase - How to Add User uid to Document

  6. 6

    Firebase Auth Get User Country

  7. 7

    Did anyone manage to get the id token from google sign in (Flutter)

  8. 8

    How to get current user address from firebase

  9. 9

    Firebase Firestore get user related data

  10. 10

    Get score and Category for specific user from Firebase

  11. 11

    Check if the Firebase user is authenticated for the first time using google in Flutter

  12. 12

    Get IP Address used to connect to Firebase from Android device

  13. 13

    Flutter Firebase Auth / Google_sign_inがstatuscode = CANCELEDでログインに失敗する

  14. 14

    Flutter how to get firebase dynamic link if app is already running?

  15. 15

    Flutter Web Firebase - Get collection by sub-collection field

  16. 16

    Flutter: How to get the GitHub master version of a firebase plugin

  17. 17

    Sign "+" is not get inside ajax

  18. 18

    PHP new user automatic sign in

  19. 19

    Xamarin Android Firebase user: how to get created date

  20. 20

    Flutter - Android Native Platform Integration

  21. 21

    for what purpose # (hash) sign is used in Joomla?

  22. 22

    test if a specific key was used to sign an .apk file

  23. 23

    Flutter Firebase authentication - unlinking authentication provider does not result in the original (anonymous) user

  24. 24

    How can I display on a widget the current user data from Firebase to Flutter

  25. 25

    Flutter FireBase google signで、指定したコードの永続性記号を維持する方法

  26. 26

    Get number before the percent sign

  27. 27

    Firebase and new Google Sign-In on Android

  28. 28

    How to properly sign out of Facebook on Android with Firebase?

  29. 29

    Firebase Auth Ui Google Sign In "Developer Error"

ホットタグ

アーカイブ