Pakete, Repositories und App-Kategorien suchen

Cover von sms_autofill
Paketdetailsv2.6.1

sms_autofill

Flutter-Plugin zur Bereitstellung von Unterstützung für die automatische Ausfüllung von SMS-Code

AndroidiOS
30-Tage-Downloads
207.000
Likes
881
Pub-Punkte
140

Paket installieren

flutter pub add sms_autofill

Paketübersicht

Aus öffentlichen Paketdaten erstellte Orientierung.

Das sms_autofill-Paket ist ein Flutter-Plugin, das die automatische Erkennung und das automatische Ausfüllen von SMS-Verifizierungs-Codes unter Android und iOS ermöglicht. Es vereinfacht die Benutzererfahrung bei Authentifizierungsprozessen, indem es einmalige Passwörter (OTPs), die per SMS gesendet werden, automatisch extrahiert, so dass manuelle Eingabefehler vermieden und die Konversionsraten verbessert werden. Das Plugin lässt sich nahtlos mit Textfeldern für die OTP-Eingabe integrieren und nutzt plattformspezifische APIs, um eingehende Nachrichten zu erkennen und das Feld programmgesteuert auszufüllen.

Anwendungsfälle

  • Automatisierte OTP-Eingabe in Anmeldevorgängen
  • Verringerung der Benutzerfriction bei der Kontoverifizierung
  • Verbesserung der Formularabschlussraten
  • Unterstützung der Zwei-Faktor-Authentifizierung
  • Schnellregistrierung mit SMS-Codes aktivieren

Hauptmerkmale

  • Automatische SMS-Code-Erkennung
  • Plattformübergreifende Unterstützung (Android & iOS)
  • Nahtlose Integration mit TextFormField
  • Minimale Einrichtung erforderlich
  • Echtzeit-Codeextraktion aus eingehenden Nachrichten

Geeignet für

  • Authentifizierungsbildschirme, die Eingabe von OTP erfordern
  • Apps mit SMS-basierter 2FA
  • Benutzer-Onboarding-Flows mit Telefonüberprüfung
  • Entwickler, die eine verbesserte Benutzererfahrung für PIN-/OTP-Felder suchen
  • Projekte, die darauf abzielen, das Verlassen von Formularen zu reduzieren

Hinweise

  • Erforderliche korrekte SMS-Nachrichtenformatierung zur Erkennung
  • Funktioniert möglicherweise nicht auf allen Geräten oder Anbietern
  • Eingeschränkte Steuerung darüber, welche Nachrichten automatisch ausgefüllt werden
  • Abhängig von Plattform-SMS-Berechtigungen
  • Nicht garantiert, in allen Emulator-Umgebungen zu funktionieren

Original-README

Originaler README-Schnappschuss aus dem verknüpften Quell-Repository. Aktuelle Inhalte finden Sie im Repository.

sms_autofill

pub package Flutter plugin to provide SMS code autofill support.

For iOS, this package is not needed as the SMS autofill is provided by default, but not for Android, that's where this package is useful.

No permission to read SMS messages is asked to the user as there no need thanks to SMSRetriever API.

Usage

You have two widgets at your disposable for autofill an SMS code, PinFieldAutoFill and TextFieldPinAutoFill.

Just before you sent your phone number to the backend, you need to let the plugin know that it needs to listen for the SMS with the code.

To do that you need to do:

await SmsAutoFill().listenForCode();

This will listen for the SMS with the code during 5 minutes and when received, autofill the following widget.

PinFieldAutoFill

PinFieldAutoFill

PinFieldAutoFill(
                decoration: // UnderlineDecoration, BoxLooseDecoration or BoxTightDecoration see https://github.com/TinoGuo/pin_input_text_field for more info,
                currentCode: // prefill with a code
                onCodeSubmitted: //code submitted callback
                onCodeChanged: //code changed callback
                codeLength: //code length, default 6
              ),
TextFieldPinAutoFill

TextFieldPinAutoFill

TextFieldPinAutoFill(
                decoration: // basic InputDecoration
                currentCode: // prefill with a code
                onCodeSubmitted: //code submitted callback
                onCodeChanged: //code changed callback
                codeLength: //code length, default 6
              ),
Android SMS constraint

For the code to be receive, it need to follow some rules as describe here: https://developers.google.com/identity/sms-retriever/verify

  • Be no longer than 140 bytes
  • Contain a one-time code that the client sends back to your server to complete the verification flow
  • End with an 11-character hash string that identifies your app

One example of SMS would be:

ExampleApp: Your code is 123456
FA+9qCX9VSu

Helper

PhoneFieldHint [Android only]

PhoneFieldHint is a widget that will allow you ask for system phone number and autofill the widget if a phone is choosen by the user.

Phone hint

Custom CodeAutoFill

If you want to create a custom widget that will autofill with the sms code, you can use the CodeAutoFill mixin that will offer you:

  • listenForCode() to listen for the SMS code from the native plugin when SMS is received, need to be called on your initState.
  • cancel() to dispose the subscription of the SMS code from the native plugin, need to be called on your dispose.
  • codeUpdated() called when the code is received, you can access the value with the field code.
  • unregisterListener() to unregister the broadcast receiver, need to be called on your dispose.
App Signature

To get the app signature at runtime just call the getter getAppSignature on SmsAutoFill. You can also find the sample code in example app.

Kategorien

Abhängigkeiten

Abhängigkeiten 2 Einträge

Quell-Repository

Projekte, die dieses Paket verwenden