ars_sms_retriever 1.0.0 ars_sms_retriever: ^1.0.0 copied to clipboard
Flutter plugin for retrieving OTP code sent in sms automatically and without getting SMS permission in Android.
ars_sms_retriever #
Flutter plugin for retrieving OTP code sent in sms automatically and without getting SMS permission in Android. You can find full API document here
Getting Started #
Install
dependencies:
flutter_paginator: ^1.0.0
Import
import 'package:ars_sms_retriever/ars_sms_retriever.dart';
App signature #
To retrieve a app signature. App signature should be placed at end of SMS so SmsRetriever API can verify SMS is sent from your server.
String appSignature = await SmsRetriever.getAppSignature();
Request phone number #
You can request android to open a dialog with user's phone numbers, then user can select one.
String phoneNumber = await ArsSmsRetriever.requestPhoneNumber();
Start listening for SMS #
To start listening for an incoming SMS
String smsCode = await ArsSmsRetriever.startListening();
Close receiver after getting SMS #
Stop listening after getting the SMS
ArsSmsRetriever.stopListening();
Note
SMS format should be like this :
Your example code is: 123456 appSignature