I am currently using twitter_login: ^4.0.1 for Twitter login in flutter with firebase and the following is my code
import 'dart:developer';
import 'package:firebase_auth/firebase_auth.dart';
import 'package:flutter/cupertino.dart';
import 'package:twitter_login/twitter_login.dart';
class TwitterLoginController with ChangeNotifier {
Future<void> signInWithTwitter() async {
// Create a TwitterLogin instance
final twitterLogin = new TwitterLogin(
apiKey: "ImkA5qfZjykyVrR3o2OBDTKmG",
apiSecretKey: "slY304BUP3FTC30WFFgo8xFnNc7ekF2KV4kinelWTZdFOLGIhI",
redirectURI: "Doyen://",
);
// Trigger the sign-in flow
final authResult = await twitterLogin.login().then((value) {
// Create a credential from the access token
final twitterAuthCredential = TwitterAuthProvider.credential(
accessToken: value.authToken.toString(),
secret: value.authTokenSecret!,
);
FirebaseAuth.instance.signInWithCredential(twitterAuthCredential);
log("this is test message");
});
return authResult;
}
}
But when I try to log in with the Twitter app is stuck on the screen which says "redirecting you back to the application. this may take a few moments". If anybody knows why it will be a great help.