Giter Club home page Giter Club logo

flutter_twitter_login_v2's Introduction

twitter_login_v2

twitter_login_v2 on pub.dev

Flutter Twitter Login Plugin

Install

twitter_login_v2: ^0.0.3

Android Configuration

Add intent filters for incoming links

/example/android/app/src/main/AndroidManifest.xm

You need to replace {example} with a Callback URLs.

<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="{example}"
        android:host="gizmos" /> <!-- host is option -->
</intent-filter>

Supporting the new Android plugins APIs

If you created your project with a version prior to 1.12, you will need to update your project to use the new Java Embedding API. Make sure flutter_embedding v2 is enabled. Add the following code on the manifest file inside tag to enable embedding.
Flutter wiki: Upgrading pre 1.12 Android projects.

<meta-data
    android:name="flutterEmbedding"
    android:value="2" />

iOS Configuration

Add URLScheme

/example/ios/Runner/Info.plist

You need to replace {example} with a Callback URLs.

<key>CFBundleURLTypes</key>
<array>
  <dict>
    <key>CFBundleTypeRole</key>
    <string>Editor</string>
    <key>CFBundleURLName</key>
    <string></string>
    <key>CFBundleURLSchemes</key>
    <array>
      <!-- Registered Callback URLs in TwitterApp -->
      <string>{example}</string>
    </array>
  </dict>
</array>

Example of usage

final twitterLogin = TwitterLoginV2(
    clientId: "CLIENT_ID", /// Consumer API keys
    redirectURI: "REDIRECT_URI", /// Registered Callback URLs in TwitterApp
    scopes: ["tweet.read", "tweet.write", "follows.read", "users.read","offline.access"]
);

final accessToken = await twitterLogin.loginV2();

The scopes that can be specified are available here: https://developer.twitter.com/en/docs/authentication/oauth-2-0/authorization-code

flutter_twitter_login_v2's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.