패키지, 저장소 및 앱 카테고리 검색

패키지 상세v4.4.2

twitter_login

Flutter 트위터 로그인 플러그인. Twitter API OAuth 서비스를 사용한 로그인용 라이브러리

AndroidiOSmacOS
30일 다운로드
7.6천
좋아요
117
Pub 점수
150

패키지 설치

flutter pub add twitter_login

패키지 개요

공개 정보를 바탕으로 생성한 선택 가이드입니다.

OAuth를 사용하여 Twitter 로그인을 가능하게 하는 플러터 플러그인으로, 사용자가 Twitter의 API를 통해 인증할 수 있도록 합니다. 안드로이드, iOS, macOS 플랫폼에서 Twitter 인증 서비스와의 통합을 간소화합니다. 플러그인은 OAuth 흐름을 안전하게 처리하고, 권한 있는 앱 상호작용을 위한 액세스 토큰을 제공합니다. Twitter를 신원 공급자로 사용하는 소셜 로그인 기능을 필요로 하는 앱에 적합합니다. 원활한 사용자 온보딩 및 보안 자격 증명 관리를 지원합니다.

사용 사례

  • Twitter로 소셜 로그인
  • 트위터를 통한 사용자 인증
  • 소셜 계정을 통한 앱 온보딩
  • 보안 OAuth 토큰 처리
  • 크로스 플랫폼 트위터 로그인

주요 기능

  • OAuth 1.0a 지원
  • 안드로이드/iOS/macOS 호환성
  • 보안 토큰 관리
  • 간단한 API 통합
  • 내장된 오류 처리

적합한 대상

  • Twitter 로그인을 필요로 하는 앱
  • 소셜 기능을 구축하는 개발자
  • 크로스 플랫폼 모바일 앱
  • 인증 중심 애플리케이션
  • OAuth 기반의 신원 공급자 사용 프로젝트

고려 사항

  • Twitter 개발자 계정이 필요합니다
  • 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 개

소스 저장소

이 패키지를 사용하는 프로젝트