搜索插件、代码仓与 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 项

源码仓库

使用此插件的项目

暂无相关数据。