android_sms_consent 1.0.1 copy "android_sms_consent: ^1.0.1" to clipboard
android_sms_consent: ^1.0.1 copied to clipboard

PlatformAndroid

Flutter plugin to perform one-tap SMS verification with the SMS User Consent API in Android.

Android SMS Consent #

Flutter plugin to perform one-tap SMS verification with the SMS User Consent API in Android.

The following criteria must meet for the API to be triggered:

  • The message contains a 4-10 character alphanumeric string with at least one number.
  • The message was sent by a phone number that's not in the user's contacts.
  • If you specified the sender's phone number, the message was sent by that number.

Usage #

  final androidSmsConsent = AndroidSmsConsent(
    pattern: r'\d{4,}',
    onAllowed: (sms) {
      print(sms);
    },
    onDenied: () {
      _scaffoldMessenger?.showSnackBar(
        const SnackBar(content: Text('User denied!')),
      );
    },
    onPatternUnmatched: () {
      _scaffoldMessenger?.showSnackBar(
        const SnackBar(
          content: Text('OTP not found! Please try entering OTP manually.'),
        ),
      );
    },
  )..start('TestOne');
2
likes
140
pub points
64%
popularity

Publisher

verified publisherkhalti.com

Flutter plugin to perform one-tap SMS verification with the SMS User Consent API in Android.

Homepage
Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (LICENSE)

Dependencies

flutter

More

Packages that depend on android_sms_consent