Issue
I am trying to determine whether the current user is authenticated in the app via Facebook login or not. I want that because if a user is authenticated via facebook than the signOut() should process
LoginManager.getInstance().logOut();
but if it is authenticated via email than simple
auth.signOut();
my cuurent code is
//sign out method
public void signOut() {
if(auth.getCurrentUser().getProviderId().equals("facebook.com")) {
LoginManager.getInstance().logOut();
auth.signOut();
}
else {
auth.signOut();
}
}
Solution
This is how you can do it:
if (firebaseUser != null) {
for (UserInfo userInfo : firebaseUser.getProviderData()) {
if (userInfo.getProviderId().equals("facebook.com")) {
Log.d("TAG", "User is signed in with Facebook");
}
}
}
Answered By - Alex Mamo Answer Checked By - Gilberto Lyons (PHPFixing Admin)
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.