I'm trying to implement twitter login in my app but it doesn't work, returning an errorMessage in the AppResult object. Does anyone know a solution?
The packages I use are twitter_login: ^4.2.3
firebase: firebase_core: ^1.11.0 firebase_auth: ^3.3.5
Twitter config (User authentication settings page):
- OAuth 1.0a enabled (is it the proper one for the plugin?)
- Request email from users: disabled
- App permissions: Read
- Callback URI: https://project-name.firebaseapp.com/__/auth/handler
- webiste url: https://www.google.com/
- besides that everything is empty
Firebase config:
- twitter auth enabled
- api key set (checked it like 10 times)
- api secret set (same thing)
Android manifest:
inside the activity tag:
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<!-- Accepts URIs that begin with "example://gizmos” -->
<!-- Registered Callback URLs in TwitterApp -->
<data android:scheme="https" android:host="app-name.firebaseapp.com" />
<!-- host is option -->
</intent-filter>
after the activity tag:
<meta-data android:name="flutterEmbedding" android:value="2" />
The code itself:
final twitterLogin = TwitterLogin(
apiKey: '123 it's the same one',
apiSecretKey: 'proper one',
redirectURI: 'https://app-name.firebaseapp.com/__/auth/handler');
final authResult = await twitterLogin.login();
print(authResult.errorMessage); // prints out HttpException: Failed Forbidden
The code opens the link with the authentication, but after clicking on "authorize app", it returns to the app with the errorMessage "HttpException: Failed Forbidden" Also, the authToken and the authTokenSecret are both null.
If you need any additional information, please let me know!