Twitter Login Flutter Android Stops

I have been working with twitters login with flutter using fire base. I am using the twitter_login module.

I have done everything as specified for building a twitter authentication.

Future loginV2() async {
  final twitterLogin = TwitterLogin(
    apiKey: 'y1fhbDb5i30UxZoiNvaFikCLm',
    // Consumer API Secret keys
    apiSecretKey: 'iBV5urzcTDsh1Vg7XdpBalGpVGDKnJmfCjTYESDAk9httBUnqz',
    redirectURI: "twitter-firebase-auth://",
  );

  final authResult = await twitterLogin.loginV2();

  final twitterAuthCredential = TwitterAuthProvider.credential(
    accessToken: authResult.authToken!,
    secret: authResult.authTokenSecret!,
  );

I am using the code above for my login.

I have updated the Firebase and the code above with the API Key and Secret.

I have also added in the manifest the Scheme as specified by the twitter_login module.

When I run the app I get taken to the authorization window for twitter.

After I click authorize it brings me back to my app. I look at the firebase the user is not being stored.

I debuged the code and when I run

final authResult = await twitterLogin.loginV2();

the program does not run the rest of the code below.

final twitterAuthCredential = TwitterAuthProvider.credential(
    accessToken: authResult.authToken!,
    secret: authResult.authTokenSecret!,
  );
  final userCredential = await _auth.signInWithCredential(twitterAuthCredential);

is there a reason why the login would case the thread to break or crash.

Marcus Vance

Marcus Vance

Cybersecurity & Digital Privacy Researcher

Marcus Vance is a cybersecurity auditor and technology writer dedicated to educating the public about online safety, data privacy regulations, enterprise security, and emerging cyber threats.

Share this article