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

alt_sms_autofill 封面
套件詳情v1.0.0

alt_sms_autofill

替代簡訊自動填入

AndroidiOS
近 30 天下載
215
喜歡數
57
Pub 分數
130

安裝套件

flutter pub add alt_sms_autofill

套件介紹

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

Alt Sms Autofill 是一個 Flutter 套件,專門設計用於自動偵測並填入 PIN、OTP 及密碼輸入欄位中的簡訊 OTP(一次性密碼)。它支援 Android 與 iOS 平台,透過從收到的簡訊中取得驗證碼,提供流暢的使用者體驗。此套件支援自訂簡訊訊息格式,並提供回呼函數來處理偵測到的驗證碼。非常適合需要透過簡訊驗證實現安全快速登入的應用程式。

適用情境

  • 從簡訊自動填入OTP
  • 透過簡訊驗證簡化使用者登入
  • 減少PIN欄位中的手動輸入錯誤
  • 支援多平台OTP輸入
  • 提升表單填寫速度

主要特色

  • 從簡訊中偵測並自動填入一次性密碼
  • 可自定義的簡訊模式比對
  • 跨平台支援(Android 與 iOS)
  • 與文字欄位的簡單整合
  • 用於處理檢測到的代碼的回調

適合對象

  • 使用簡訊驗證的驗證流程
  • 需要快速輸入OTP的應用
  • 開發安全登入系統的開發者
  • 面向全球用戶的移動應用
  • 需要最少設定即可實現OTP自動填入的項目

使用建議

  • 需要 Android 的簡訊權限
  • 如果簡訊格式不符合預期模式,可能無法正常運作
  • 僅限具備簡訊存取權限的裝置
  • iOS 需要額外設定才能實現完整功能
  • 取決於設備級別的簡訊處理功能

原始 README

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

alt_sms_autofill

Alt Sms Autofill.

Getting Started

This project is for getting new arrived sms and shows on application. Sms completely return into application and you can split it as you want.

Usage

Add it to your pubspec.yaml file:


dependencies:

alt_sms_autofill: version

In your library add the following import:


import 'package:alt_sms_autofill/alt_sms_autofill.dart';

Here is an example how to use:

class _MyAppState extends State<MyApp> {
  String _commingSms = 'Unknown'; 

  Future<void> initSmsListener() async {

    String commingSms;
    try {
      commingSms = await AltSmsAutofill().listenForSms;
    } on PlatformException {
      commingSms = 'Failed to get Sms.';
    }
    if (!mounted) return;

    setState(() {
      _commingSms = commingSms;
    });

  }

  @override
  void dispose() {

    AltSmsAutofill().unregisterListener();
    super.dispose();

  }

  @override
  Widget build(BuildContext context) {

    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('AltAutoFill example app'),
        ),
        body: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: [
            Center(
              child: Text('Running on: $_commingSms\n'),
            ),
            TextButton(
              child: Text('Listen for sms code'),
              onPressed: initSmsListener,
            ),
          ],
        ),
      ),
    );

  }

parameters

  • listenForCode() to listen for the SMS code from the native plugin when SMS is received.
  • unregisterListener() to unregister the broadcast receiver, need to be called on your dispose.

#ff packages pub publish

所屬分類

原始碼儲存庫

使用此套件的專案

暫無相關資料。