'How to prevent auto switch to website when send otp firebase

How to use Firebase Authentication to send OTP to phone without show website when click send. I have tried anyway but it always switch to website when i click button Send code.



Solution 1:[1]

Most of the times while implementing dependencies like:

implementation 'androidx.browser:browser:1.2.0' 

the above window pops-up in the browser.

Here, is a way to resolve it successfully.

  1. In the Google Cloud Console, enable the Android DeviceCheck API for your project. The default Firebase API Key will be used, and needs to be allowed to access the DeviceCheck API.

enter image description here

  1. If you haven't yet specified your app's SHA-256 fingerprint, do so from the Settings Page of the Firebase console. Refer to Authenticating Your Client for details on how to get your app's SHA-256 fingerprint.

enter image description here

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 Sambhav. K