Android Tutorial Facebook login no event raised fix

Hi,

If your Facebook and firebase configurations are all ok but the auth event is not raising or if you are getting An account already exists with the same email address but different sign-in credentials. Sign in using a provider associated with this email address. error message then this tutorial is for you.

There are many posts in this forum regarding facebook login problem. And 99% of that doesn't have a solution. And there are some fixes like one of those is deleting authenticated user from firebase console. So you have to delete that user from firebase console before signing out.

So here is the solution follow these simple steps,
  1. Login to firebase console
  2. Click on the firebase app
  3. Go to Authentication tab
  4. Go to sign-in method
  5. Scroll down to Multiple accounts per email option
  6. Click on change and you will see this popup
  7. Now choose Prevent creation of multiple accounts with the same email address and save it.
  8. Now before signing out delete that user info from firebase as follows,
    B4X:
    If auth.CurrentUser.IsInitialized Then
        Dim j As JavaObject = auth.CurrentUser
        j.RunMethod("delete",Null)
        'for iOS (B4I)
        'Dim no As NativeObject = auth.CurrentUser
        'no.RunMethod("deleteWithCompletion:",Null)
    End If
    facebook.SignOut
    auth.SignOutFromGoogle

  9. That's it.
Now your Facebook Login will work and the event will raise every time.
 
Last edited:
Cookies are required to use this site. You must accept them to continue using the site. Learn more…