AndroidSmsRetriever class

AndroidSmsRetriever

Constructors

AndroidSmsRetriever()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

deleteStoredPhoneNumber(String url, String phoneNumber) Future<void>
To delete stored phone number use this function. You should pass your application's website URL and phone number to this function.
getAppSignature() Future<String?>
Use this function to get application signature. App signature should be placed at end of SMS so SmsRetriever API can verify SMS is sent from your server.
listenForOneTimeConsent({String? senderPhoneNumber}) Future<String?>
Using this function, when sms received android will ask user to let application use message and extract code, even if sms message does not contain application signature. You can pass sender phone number in order to detect messages sent from specific sender.
listenForSms() Future<String?>
Use this function to start listening for an incoming SMS. When sms received message will be returned.
requestOneTimeConsentSms({String? senderPhoneNumber}) Future<String?>
requestPhoneNumber() Future<String?>
You can request android to open a dialog with user's phone numbers, then user can select one.
retrieveStoredPhoneNumber(String url) Future<String?>
To retrieve stored phone number use this function. You should pass your application's website URL to this function.
startSmsListener() Future<String?>
stopOneTimeConsentListener() Future<void>
Stop listening for one time consent SMS. It's better to stop listener after getting message.
stopSmsListener() Future<void>
Stop listening for SMS. It's better to stop listener after getting message.
storePhoneNumber(String url, String phoneNumber) Future<void>
You can store user's phone number to use later, For example: When user uninstalls application and installs again. You should pass your application's website URL and phone number to this function.