パッケージ、リポジトリ、アプリカテゴリを検索

パッケージ詳細v4.4.2

twitter_login

Flutter Twitter ログインプラグイン。Twitter API の OAuth サービスを使用したログイン用ライブラリ

AndroidiOSmacOS
30日間ダウンロード
7640
いいね数
117
Pub ポイント
150

パッケージをインストール

flutter pub add twitter_login

パッケージ概要

公開情報に基づく選定ガイドです。参考としてご利用ください。

OAuth を使用して Twitter ログインを可能にする Flutter プラグインで、ユーザーが Twitter の API を通じて認証できるようにします。Android、iOS、macOS プラットフォーム間での Twitter 認証サービスとの統合を簡素化します。プラグインは OAuth フローを安全に処理し、承認されたアプリケーション相互作用用のアクセス トークンを提供します。Twitter を ID プロバイダーとして使用するソーシャルログイン機能を必要とするアプリに最適です。スムーズなユーザーオンボーディングと安全な資格情報管理をサポートしています。

用途

  • Twitterによるソーシャルログイン
  • Twitterを介したユーザー認証
  • ソーシャルアカウントによるアプリオンボーディング
  • セキュアな OAuth トークンの取り扱い
  • クロスプラットフォームのTwitterログイン

主な機能

  • OAuth 1.0a のサポート
  • Android/iOS/macOS互換性
  • セキュアなトークン管理
  • シンプルなAPI統合
  • 組み込みエラー処理

適している対象

  • Twitterログインが必要なアプリ
  • ソーシャル機能を開発する開発者
  • クロスプラットフォームモバイルアプリ
  • 認証を重視したアプリケーション
  • OAuthベースのIDプロバイダーを使用するプロジェクト

注意事項

  • Twitter Developerアカウントが必要です
  • Twitter Developer Portalで適切なアプリケーション設定が必要です
  • OAuth 1.0a に制限されています(OAuth 2.0 は対応していません)
  • Twitter API の利用可能性に依存します
  • 追加のプライバシーポリシーに関する開示が必要になる場合があります

元の README

関連するソースリポジトリの README 原文のスナップショットです。最新の内容はリポジトリをご覧ください。

twitter_login

Pub Version

Flutter Twitter Login Plugin

Requirements

  • Dart sdk: ">=2.12.0-0 <3.0.0"
  • flutter: ">=1.25.0-8.1.pre"
  • Android: minSdkVersion 17 and add support for androidx
  • iOS: --ios-language swift, Xcode version >= 11

Twitter Configuration

Twitter Developer

required to create TwitterApp.
this plugin is need Callback URLs.

please register a different callback URL on Twitter Developers.

app_name://

If the API is not set to get email, email may be null. If you want to use email, turn on Request email address from users.

Android Configuration

Add intent filters for incoming links

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

You need to replace the scheme 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 flutter created your project prior to version 1.12, you need to make sure to update your project in order to use the new Java Embedding API.
Make use you have flutter_embedding v2 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 the 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 code

See the example directory for a complete sample app using twitter_login.

example

Usage

To use this plugin, add twitter_login as a dependency in your pubspec.yaml file.

Example
import 'package:flutter/material.dart';
import 'package:twitter_login/twitter_login.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Twitter Login App'),
        ),
        body: Center(
          child: FlatButton(
            child: Text('Login With Twitter'),
            onPressed: () async {
              final twitterLogin = TwitterLogin(
                // Consumer API keys
                apiKey: 'xxxx',
                // Consumer API Secret keys
                apiSecretKey: 'xxxx',
                // Registered Callback URLs in TwitterApp
                // Android is a deeplink
                // iOS is a URLScheme
                redirectURI: 'example://',
              );
              final authResult = twitterLogin.login();
              switch (authResult.status) {
                case TwitterLoginStatus.loggedIn:
                  // success
                  break;
                case TwitterLoginStatus.cancelledByUser:
                  // cancel
                  break;
                case TwitterLoginStatus.error:
                  // error
                  break;
              }
            },
          ),
        ),
      ),
    );
  }
}

カテゴリー

依存関係

依存関係一覧 2 件

ソースリポジトリ

このパッケージを使用しているプロジェクト