getSmsWithRetrieverApi method
Future<SmartAuthResult<SmartAuthSms> >
getSmsWithRetrieverApi({
- String matcher = _defaultCodeMatcher,
Starts listening to SMS that contains the App signature getAppSignature in the text returns code if it matches with matcher More about SMS Retriever API https://developers.google.com/identity/sms-retriever/overview?hl=en
Implementation
Future<SmartAuthResult<SmartAuthSms>> getSmsWithRetrieverApi({
/// used to extract code from SMS
String matcher = _defaultCodeMatcher,
}) async {
try {
final result = await _api.getSmsWithRetrieverApi();
return SmartAuthResult.success(
SmartAuthSms.fromSms(result, matcher),
);
} catch (error) {
debugPrint('Pinput/SmartAuth: getSmsWithRetrieverApi failed: $error');
return SmartAuthResult.failure(
'Failed to get SMS with retriever API with error: $error',
);
}
}