Dennis Ashford
Dennis Ashford

Reputation: 1430

Firebase, Flutter: Check if User Signed In With Apple

Did some searching and couldn't find exactly what I was looking for. Is there a way to determine if a user signed in with Apple (or really any other provider) in Firebase with Flutter? See the image below. Firebase knows it was an Apple sign in, but not sure how to check the provider to see if was Apple or another method.

enter image description here

Upvotes: 0

Views: 641

Answers (1)

Rohan Jariwala
Rohan Jariwala

Reputation: 2048

You can access FirebaseUser property called providerData which type is List. UserInfo has a providerId which is for ex. google.com, facebook.com, apple.com, password (email) or phone.

You can find those values looking up the code.

print(user.providerData[0].providerId) // -> fe. google.com

Upvotes: 2

Related Questions