flutter_twitter 1.1.3 copy "flutter_twitter: ^1.1.3" to clipboard
flutter_twitter: ^1.1.3 copied to clipboard

A Flutter plugin for allowing users to authenticate with native Android & iOS Twitter login SDKs.

flutter_twitter #

pub package Build Status Coverage Status

A Flutter plugin for using the native TwitterKit SDKs on Android and iOS.

This plugin uses the new Gradle 4.1 and Android Studio 3.0 project setup.

Dart support #

  • Dart 1: 1.0.x.
  • Dart 2: 1.1.0 and up.

Before instalation #

Before you begin it is important to properly configure your application at https://apps.twitter.com/

It is important to configure the callback URLs so that everything works correctly in your application.

You will have to use the following callback URLs:

Android - twittersdk: //

iOS - twitterkit-CONSUMERKEY: //

FOR MORE INFORMATION READ: https://developer.twitter.com/en/docs/basics/developer-portal/guides/callback-urls.html

Complete Guide on

Configure Info.Plist #

Twitter Kit looks for a URL scheme in the format twitterkit-

You can find your consumer key in the Twitter app dashboard.

In your app's Info.plist, add URL Schemes by adding code below after

// Info.plist
<key>CFBundleURLTypes</key>
<array>
  <dict>
    <key>CFBundleURLSchemes</key>
    <array>
      <string>twitterkit-<consumerKey></string>
    </array>
  </dict>
</array>
<key>LSApplicationQueriesSchemes</key>
<array>
    <string>twitter</string>
    <string>twitterauth</string>
</array>

Installation #

See the installation instructions on pub. No platform-specific configuration is needed!

How do I use it? #

Here's some sample code that should cover most of the cases. For full API reference, just see the source code. Everything is documented there.

var twitterLogin = new TwitterLogin(
  consumerKey: '<your consumer key>',
  consumerSecret: '<your consumer secret>',
);

final TwitterLoginResult result = await twitterLogin.authorize();

switch (result.status) {
  case TwitterLoginStatus.loggedIn:
    var session = result.session;
    _sendTokenAndSecretToServer(session.token, session.secret);
    break;
  case TwitterLoginStatus.cancelledByUser:
    _showCancelMessage();
    break;
  case TwitterLoginStatus.error:
    _showErrorMessage(result.error);
    break;
}
18
likes
30
pub points
64%
popularity

Publisher

unverified uploader

A Flutter plugin for allowing users to authenticate with native Android &amp; iOS Twitter login SDKs.

Repository (GitHub)
View/report issues

License

BSD-2-Clause (LICENSE)

Dependencies

flutter

More

Packages that depend on flutter_twitter