搜尋套件、儲存庫與 APP 分類

套件詳情v2.0.0

twilio_phone_verify

一個使用 Twilio 驗證電話號碼和電子郵件地址的套件。

AndroidiOSWebmacOSWindowsLinux
近 30 天下載
61
喜歡數
29
Pub 分數
130

安裝套件

flutter pub add twilio_phone_verify

套件介紹

根據套件公開資料產生的選型評估,僅供參考。

twilio_phone_verify 包透過使用 Twilio 的通訊服務,簡化了 Flutter 應用中的電話號碼和電子郵件驗證。它讓開發者能夠透過簡訊或電子郵件發送驗證碼,驗證使用者輸入,並安全地管理驗證流程。該套件支援 Android、iOS、Web、macOS、Windows 和 Linux 等多個平台,非常適合需要強大身分驗證功能的跨平台應用。透過簡單的整合,它簡化了雙因素認證與使用者入門流程的實作。

適用情境

  • 用戶註冊並進行手機/電子信箱驗證
  • 兩步驗證設定
  • 安全的入門流程
  • 透過已驗證的聯繫人進行帳戶恢復
  • 跨平台驗證
  • 即時程式碼驗證

主要特色

  • 由 Twilio 提供支援的簡訊和電子郵件驗證
  • 對多個平台的支援
  • 用於發送和驗證代碼的簡單 API
  • 內建錯誤處理
  • 跨平台相容性
  • 與現有認證系統的整合

適合對象

  • Flutter 應用需要安全的使用者驗證
  • 使用 Twilio 進行通訊的開發人員
  • 需要雙重身分驗證的應用程式
  • 初創公司正在構建使用者引導功能
  • 開發多平台應用程式的團隊
  • 優先實現快速驗證的項目

使用建議

  • 需要一個 Twilio 帳戶和 API 憑證
  • 根據使用情況可能會產生費用
  • 驗證需要網路連接
  • 與直接使用 Twilio SDK 相比,自訂選項較少
  • 取決於 Twilio 服務的可用性
  • 簡訊遞送可能有延遲

原始 README

以下為關聯原始碼儲存庫的 README 原文快照,最新內容請造訪原始碼儲存庫。

Twilio_Phone_Verify

A Package that helps in verifying phone numbers and email addresses using Twilio.

Usage

To use this package :

  • add the dependency to your pubspec.yaml file.
dependencies:
  flutter:
    sdk: flutter
  twilio_phone_verify:
How to use
Create a new Object
TwilioPhoneVerify _twilioPhoneVerify; 
Initialize with values
_twilioPhoneVerify = new TwilioPhoneVerify(
        accountSid: '*************************', // replace with Account SID
        authToken: 'xxxxxxxxxxxxxxxxxx',  // replace with Auth Token
        serviceSid: 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' // replace with Service SID
        );
Phone number verification
Send Code to Phone
 var twilioResponse =
        await _twilioPhoneVerify.sendSmsCode('phone');

    if (twilioResponse.successful)  {
      //code sent
    } else {
      //print(twilioResponse.errorMessage);
    }
Verify Code
    var twilioResponse = await _twilioPhoneVerify.verifySmsCode(
        phone: 'phone', code: 'code');

    if (twilioResponse.successful) {
      if (twilioResponse.verification.status == VerificationStatus.approved) {
        //print('Phone number is approved');
      } else {
        //print('Invalid code');
      }
    } else {
      //print(twilioResponse.errorMessage);
    }
Email Verification

Twilio Verify email channel requires additional Service configuration. Please refer to the email channel setup documentation for detailed instructions.

Send Code to Email
 var twilioResponse =
        await _twilioPhoneVerify.sendEmailCode('email');

    if (twilioResponse.successful)  {
      //code sent
    } else {
      //print(twilioResponse.errorMessage);
    }
Verify Email Code
    var twilioResponse = await _twilioPhoneVerify.verifyEmailCode(
        email: 'email', code: 'code');

    if (twilioResponse.successful) {
      if (twilioResponse.verification.status == VerificationStatus.approved) {
        //print('Email is approved');
      } else {
        //print('Invalid code');
      }
    } else {
      //print(twilioResponse.errorMessage);
    }
Override Email configurations
 var twilioResponse =
        await _twilioPhoneVerify.sendEmailCode('email',channelConfiguration:
    EmailChannelConfiguration(
        from: "override@example.com",
        from_name: "Override Name",
        template_id: "d-4f7abxxxxxxxxxxxx",
		usernameSubstitution: "Foo Bar"
    ));

    if (twilioResponse.successful)  {
      //code sent
    } else {
      //print(twilioResponse.errorMessage);
    }

Features

  • [x] Phone verification
  • [x] Email verification.

Getting Started

For help getting started with Flutter, view our online documentation.

For help on editing package code, view the documentation.

所屬分類

依賴

依賴清單 1 項

原始碼儲存庫

使用此套件的專案

暫無相關資料。