'Auto Read OTP in flutter using firebase is possible?

I have same problem and search a lot . But can't find exact Solution.

But I solve this problem by enabling 'Android Device Verification' API

Steps: 1:Go to the Library page in the Google APIs Console.

2:Search for, and select, the Android Device Verification API. The Android Device Verification API dashboard screen appears.

3:If the API isn't already enabled, click Enable.

4:If the Create credentials button appears, click on it to generate an API key. Otherwise, click the All API credentials drop-down list, then select the API key that's associated with your project that has enabled the Android Device Verification API.

Check this link for more information https://developer.android.com/training/safetynet/attestation?authuser=0

The following package helps for auto reading of OTP

  1. sms_autofill https://pub.dev/packages/sms_autofill


Solution 1:[1]

This is a Similar issue for android mentioned, and Below are few work around:

  1. You need to make sure the message you receive contains the hash of your app. Below is the right format :

123456 is your verification code for %APP_NAME%.
abc_hascode_xyz

  1. If your SMS does not contain the hashCode at the end, you might have to shorten your app name to not more than 15 characters.

  2. If your app is already published on Google Play, the name in the SMS will be the same as the one in the Google play store.

  3. If you changed the name to 15 characters and the error still persists, you might have to wait for at least 24hours for the change to reflect on firebase.

  4. if after all above it's still not resolved, please check if your receiver is well configured in the code.

check out the new GooglePlay policy on app name : Examples of common app names violations

Solution 2:[2]

Firebase auth with the phone automatically detects OTP in the phone itself. But in few cases, OTP is not fetched by itself so I would like to suggest you please make a template such that OTP automatically gets detected.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Gomez NL
Solution 2 Raushan Kumar