[CRASH + DISCUSSION] Should we request Twitter email transparently?
See original GitHub issueWhile working on another PR, I came across this crash:
12-03 12:05:15.217 16688-16688/com.firebase.uidemo E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.firebase.uidemo, PID: 16688
java.lang.IllegalArgumentException: Given String is empty or null
at com.google.android.gms.common.internal.zzac.zzdv(Unknown Source)
at com.google.firebase.auth.FirebaseAuth.fetchProvidersForEmail(Unknown Source)
at com.firebase.ui.auth.ui.idp.CredentialSignInHandler.onComplete(CredentialSignInHandler.java:73)
at com.google.android.gms.tasks.zzc$1.run(Unknown Source)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6088)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
It’s caused by this line of code and occurs if a user has an existing account and there is a FirebaseAuthUserCollisionException
.
To solve this problem, there are two solutions:
- Check for a null email in
CredentialSignInHandler
and fail the sign in if the email is null. - Use
TwitterAuthClient#requestEmail
to show the request email activity.
I prefer solution 2 because we are being more transparent about requesting a user’s email, but it requires more steps and a Twitter user might not have an email: https://docs.fabric.io/android/twitter/log-in-with-twitter.html#request-user-email-address
@samtstern @amandle What should we do?
Issue Analytics
- State:
- Created 7 years ago
- Comments:20 (8 by maintainers)
Top Results From Across the Web
How to recognize authentic Twitter emails | Twitter Help
Learn the features of real emails from Twitter that you can trust, and how to recognize and avoid fraudulent emails.
Read more >- TWITTER: TRANSPARENCY AND ACCOUNTABILITY
When you and your co-creators founded Twitter in 2006, you probably never envisioned the issues we are going to discuss today: so-called ``shadow-banning,'' ......
Read more >The weird sorrow of losing Twitter - Vox
So, yes, there is a reason to mourn. The reality is that this is a hard time: Even if Twitter doesn't collapse, it...
Read more >A travel writer tweeted her salary and reignited a trend
The tweet started a conversation about pay transparency and how it can ... if you apply for my old job as Senior Travel...
Read more >When Journalists Tweet: Disclosure, Participatory, and ...
It also answers a call from previous researchers on transparency on Twitter ... Twitter indeed discuss how the news are produced (disclosure transparency), ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@cutiko You’re totally fine, that’s why FirebaseUI has public issues! 😄
@samtstern Hopefully my comment and the above will help you understand why we need the email. Adding the null check in
CredentialSignInHandler
fixes the crash for Twitter users without an email, but we still need the email before the user is signed to perform linking for Twitter users with an email.@cutiko Yes, the plan is to force you guys to request the email permission (or at least if you don’t neither account linking nor Smart Lock will work).
The fix should be out by FirebaseUI v1.1.0! 🎉
A fix for this issue has been released in version
1.1.0