Signin with LinkedIn + firebase auth + Flutter in iOS

284

After searching and trying so many things i found solution -

When we are creating user using firebase admin api https://firebase.google.com/docs/auth/admin/manage-users#create_a_user it will not allow you to put provider details so for creating new user from admin api use import user https://firebase.google.com/docs/auth/admin/import-users#import_users_without_passwords to add provider data in user information.

Once that is done iOS will give you proper user information with email. My issue is fixed.

If anyone phasing this issue can try this.

Share:
284
KDOSHI
Author by

KDOSHI

Updated on December 31, 2022

Comments

  • KDOSHI
    KDOSHI over 1 year

    I have flutter app which is using linkedin_login: ^2.0.1 plugin & firebase_auth: ^3.1.0 enter code here in Flutter

    I am using LinkedInAuthCodeWidget and giving auth state and auth token to CloudFunction and return JWT customtoken for login for that user.

    and after that using firebase method FirebaseAuth.instance.signInWithCustomToken(token) to Login same user.

    In this all working for Android but for iOS I am not able to get email id of Firebase auth user.

    I already tried FirebaseAuth.instance.currentUser.reload() to retrieve the latest User profile but not able to get the details.

    User object received for iOS -

    (displayName: Test Krunal, email: null, emailVerified: true, isAnonymous: false, metadata: UserMetadata(creationTime: 2021-09-01 12:10:07.330, lastSignInTime: 2021-09-01 12:10:09.056), phoneNumber: null, photoURL: null, providerData, [], refreshToken: , tenantId: null, uid: linkedin:cNEwfSiQjM)
    

    User object received for Android -

    (displayName: Test Krunal, email: [email protected] , emailVerified: true, isAnonymous: false, metadata: UserMetadata(creationTime: 2021-09-01 12:10:07.330, lastSignInTime: 2021-09-01 12:10:09.056), phoneNumber: null, photoURL: null, providerData, [], refreshToken: , tenantId: null, uid: linkedin:cNEwfSiQjM)