PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Saturday, July 16, 2022

[FIXED] How can I create a facebook login page with firebase in flutter if "SignInWithFacebook" is not available anymore?

 July 16, 2022     facebook-login, firebase, firebase-authentication, flutter     No comments   

Issue

I'm trying to have a facebook login page but everywhere I see they use signInWithFacebook, unfortunately it seems they've modified it and it's not available anymore, what should I do instead? Thanks for your help!

class _AuthScreenState extends State<AuthScreen> {


FirebaseAuth _auth = FirebaseAuth.instance;

bool isLogged = false;

Future<FirebaseUser> _loginWithFacebook() async {
 var facebookLogin = new FacebookLogin();
 var result = await 
  facebookLogin.logInWithReadPermissions(["email"]);

  debugPrint(result.status.toString());

if (result.status == FacebookLoginStatus.loggedIn) {
   FirebaseUser user = await _auth.????/

  }

}

Solution

I was able to figure it out, I needed to have "signInWithCredential(FacebookAuthProvider.getCredential(accessToken:))" instead of signInWithFacebook.I saw it is the same for Google sign in, where instead of using "FacebookAuthProvider" you need to use "GoogleAuthProvider"!



Answered By - Ricardo Oscar Kanitz
Answer Checked By - Marilyn (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing