-
Notifications
You must be signed in to change notification settings - Fork 591
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Firebase phone auth OTP no longer being read automatically #2688
Comments
I found a few problems with this issue:
|
Hi @vijtheveg Thank you for the provided details. I haven't been able to reproduce it on our end yet. A sample project where the issue can be reproduced will significantly help the investigation. Also, let us know if you noticed any patterns like issues occurred on some model devices etc. |
Thanks @aguatno, for your response. It takes considerable amount of time to create a working sample app using Firebase auth and given that my code has not changed at all in the past 6 months, and is virtually identical to the code in your documentation, something else is happening. The only other change that I can think of is that my app name as specified in the Play Store changed from 'MeraBills' to 'MeraBills - Small Business Management & Accounting.' Consequently, the receive SMS looks like: '697874 is your verification code for MeraBills - Small Business Management & Accounting.' - do you think the presence of the special characters in the app name (-, & and .) may be causing problems with the SMS parsing? The only LogCat line that seems to appy to this problem is the one below: |
FYI, I removed special characters from the app name - this problem continues to happen |
Hi, @vijtheveg, @aguatno I have also faced this issue, but for me how this occurred is different. Before publishing my app in playstore in OTP messages there use to be the app's hash value which helped in automatically detecting the OTP messages and authenticating. But since I published it on the play store the hash value got replaced by the app's name and no longer I am able to verify OTP automatically. |
Thanks, Atul. What is the "app's hash value" - where can I find it? |
@vijtheveg you can check this link but after generating we can't add it to our OTP messages. |
Hey there, Malcolm from Firebase here. Right now, this is expected behavior - your application's name is long enough that is crowds out the application hash from the SMS. However, I think I might have a way of more appropriately assessing when to include/exclude application hashes that should leave you with fewer pain points. For the moment:
|
Thank you, Malcolm! So, shortening the application name to around 10-15 characters from its current length will be a workaround, correct? |
It looks like shortening the name of the app does indeed fix the problem! The OTP is being read correctly, now that I shortened the app name. @malcolmdeck if this issue cannot be remedied, can it at least be documented, so people are aware of the implications of the length of the app's name? @Iltwats - it looks like you were right about the missing hash being the problem! |
@vijtheveg which app name do I need to change, on firebase? |
@Jcardif you have to change your app's name on playstore, not on firebase. |
Nice discussion! I am looking same issue. |
@malcolmdeck the 10-15 chars is for the English language. I would imagine shortening the text from your side would help. |
to what maximum length we can have our app name any idea? |
@shubhamdeol I guess it's up to 50-60 characters, as currently in my App's OTP message, length is around 50. |
my app has 49 characters to be exact, still auto verification is not working for us. Can you tell your exact length |
Any workaround to make this work? |
@orierel no workaround brother, Nothing worked for me. I had to rollback to previous react native and react native auth versions, the ones I was using before |
Officials of Firebase please rectify this issue my seniors thinks that I don't know how to implement Firebase Auth....lol. Here is my build.gradle (Project Level) ` buildscript {
}
}` And Here is my build.gradle (App level) ` apply plugin: 'com.android.application'
}
//WorkRequest
} Please let me know if anything I am missing |
Hi |
Facing exactly same issue and My Apps name is 30 character long in google play console. |
how long it's been since you changed your app's name ? |
approx 3-4 months |
Hey, I got the same issue, what you all wrote help me to understand what was wrong. "123456 is your verification code for MyApp Preprod." -> English ; App Name "MyApp Preprod" ; working Hope it can help with the issue. Right now I will keep to english only ; I think the solution is to lower the limit of app name, depending of the rest of the message ? Edit : I thought it was using "firebaseAuth.useAppLanguage()" ; but it seems that it comes from a change in the Firebase Console, in Authentication -> Templates -> Template language (in the bottom) that I switched to French and then I got the issue. |
These all are workarounds. In previous versions auto verify used to work even with longer app names. |
@malcolmdeck |
Can Firebase use the public-facing name configured in the Firebase project instead of using the app's name from Google Play? So that at least we don't have to change the name in Google Play where it is common to have it as "{name}: short tag line" (e.g. "Duolingo: language lessons"). Or maybe just trim the app name to the maximum length that allows the SMS Retriever API hash to fit? |
which name to change from the code side or only the display name of google play console. |
@subhadeepquantiantech Display name at Google Play Console |
Reporting the same issue. Developers are not allowed to change the SMS verification template.
|
I'm facing the same issue, i just don't understand how hash is related to app name? firebase can't handle few characters? |
The issue is due to the size limit of the SMS message. If the app name is too long, then the hash gets omitted from the end. The SMS Retrieval API requires the app hash to read the SMS meant for that app - https://developers.google.com/identity/sms-retriever/overview Modifying the template from "verification code" to "OTP" isn't trivial since the translated text in various languages need to be updated too and "OTP" might not have a suitable translation. Dropping the word "verification" from the template will save some characters. We can look into this, but unable to promise a timeline for this. |
I mean dropping the word "verification" would be a good start. English is a language that a lot of people can understand. I would just always use the English SMS template then. That would already help a lot @prameshj |
Thanks for the input! we are evaluating this change and I will post updates here. |
I think it would be interesting to warn the user it could happen either on the Firebase Console, or in the documentation for the developer (having a too long app name, changing template language could prevent the OTP from being read automatically) |
How to shorten app name can anyone please guide me? |
Go to play store and reduce the size of your app name. |
can I customize the firebase OTP digits from 6 to 4? |
Hi @rais660, AFAIK we don't have any way of customizing our OTP digit count, it's always 6 digits. |
If anyone is looking for a quick fix use this https://androidwave.com/auto-read-otp-android-user-consent-api/ just make sure you set your timeout request to this 'setTimeout(0L, TimeUnit.SECONDS)' |
This issue has been alive for far too long. It is a very severe issue for us can you please prioritise this as it is forcing us to switch to another auth provider instead of firebase. As the name of our app matters to the play store users we cannot change that. |
Asked from Firebase Support, they said that max length of English SMS is 64 characters. And this has to include the 11-digit hash code. So basically, for the OTP SMS: "123456 is your verification code for :APPNAME: fHlfLWxxEoP" 14 characters left for the application name in my calculation. This is pretty annoying, but I guess "64 I just wish one could edit the template a bit to make little room for app name. Or at least provide some sort of guidance in the documentation that there would be no guesswork. |
At least in English there is some wiggle room for apps with short names. In other languages like Tamil or Malayalam, the template text itself is so long that the code is guaranteed to be cut off, regardless of the length of the app name |
Incredible.... |
unbelievable |
Android device: Any device
Android OS version: Any version (have tested this starting from OS21 all the way to the latest OS - bug repros everywhere)
Google Play Services version: com.google.gms:google-services:4.3.8
Firebase/Play Services SDK version: com.google.firebase:firebase-auth:21.0.1
FirebaseUI version: com.firebaseui:firebase-ui-auth:7.1.1
Steps to reproduce:
OTP was being read automatically in my app for many months now. It has suddenly stopped working in the last few weeks. There are no specific steps to reproduce - OTP is never read automatically anymore. My code (which has been working for many months now) has not changed at all - it is pretty much the same as the code in the Firebase Auth documentation / samples - nothing special here.
I have verified that the SMS template being used is correct and matches the OTP received. I have also enabled Android SafetyNet / app verification, to no avail.
I filed an issue in the Firebase Auth UI repo (firebase/FirebaseUI-Android#1948) and was directed to file an issue here instead.
The text was updated successfully, but these errors were encountered: