パッケージ、リポジトリ、アプリカテゴリを検索

sms_user_consent のカバー
パッケージ詳細v0.1.0

sms_user_consent

ユーザーの電話番号(デュアルSIM対応)と/またはSMSを読み取ることへの同意を要求するが、追加の権限は不要

Android
30日間ダウンロード
93
いいね数
85
Pub ポイント
160

パッケージをインストール

flutter pub add sms_user_consent

パッケージ概要

公開情報に基づく選定ガイドです。参考としてご利用ください。

sms_user_consent パッケージは、明示的な権限を必要とせずに、Flutter アプリが Android でユーザーの電話番号および/または SMS メッセージの読み取り許可をリクエストできるようにします。このパッケージは Android の組み込み SMS 権限システムを利用しており、ユーザーが標準的なシステムダイアログを通じてアクセスを許可できるようにしています。デュアル-SIM デバイスをサポートしており、さまざまな Android ハードウェアとの互換性を確保しています。OTP 認証や SMS を用いた認証が必要なアプリケーションに最適であり、プロセスを簡素化しつつプライバシーとセキュリティを維持します。

用途

  • OTP検証
  • SMSベースの認証
  • デュアルSIMデバイス対応
  • プライバシーを守るSMSアクセス
  • ユーザー同意の収集

主な機能

  • 追加の権限は不要です
  • デュアルSIM対応
  • Android専用のサポート
  • システムレベルの同意ダイアログ
  • 電話番号の取得

適している対象

  • OTP入力が必要なアプリ
  • 認証フロー
  • マニフェスト権限なしでのSMS読み取り
  • Android向けアプリ
  • 最小権限アプリ

注意事項

  • Android専用
  • ユーザーの操作が必要です
  • SMSの読み取りに限定
  • iOS 対応なし
  • システムレベルの同意に依存します

元の README

関連するソースリポジトリの README 原文のスナップショットです。最新の内容はリポジトリをご覧ください。

sms_user_consent

Request user's phone number (supports dual sim) and/or consent to read SMS without adding any permissions, using Android's SMS User Consent API

Screenshots

Steps to use

1] Create an instance, optionally supply phone number listener and sms listener

SmsUserConsent smsUserConsent = SmsUserConsent(
        // optionally, do something when user selects a number.
        // You can even add/update this listener later on by simply 
        // calling smsUserConsent.updatePhoneNumberListener(updatedListener)
        phoneNumberListener: () {},
        
        // optionally, do something when user receives sms.
        // You can even add/update this listener later on by simply 
        // calling smsUserConsent.updateSmsListener(updatedListener)
        smsListener: () {}
);

2a] OPTIONAL : Request user's phone number

smsUserConsent.requestPhoneNumber();

Once the user selects a phone number, it can be accessed as

smsUserConsent.selectedPhoneNumber;

2b] OPTIONAL : Request to receive SMS

smsUserConsent.requestSms(); 

or you can specify the phone number you wish to capture the SMS from

smsUserConsent.requestSms(senderPhoneNumber: sender_number);

Once the user receives a SMS and the user taps Allow, it can be accessed as

smsUserConsent.receivedSms;

3] Finally, dispose the instance

smsUserConsent.dispose();
Note

As per the SMS User Consent API, message will be received by the plugin only if it meets these criteria:

  • 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.

Contributing

  • Found a bug or idea to improve the plugin? Send a PR.
  • Found this plugin helpful and want to thank me? I love :coffee:
  • Want to hire me for a gig? Let's talk on LinkedIn

License

MIT © 2020 Harsh P

カテゴリー

ソースリポジトリ

このパッケージを使用しているプロジェクト

データはまだありません。