question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Remove dependency on Activity for Firebase Authentication

See original GitHub issue

What feature would you like to see?

Describe the feature you would like to add, ideally proposing a specific API.

After the latest release https://firebase.google.com/support/release-notes/android#auth_v20-0-0 in order to do PhoneAuthProvider.verifyPhoneNumber we need to pass an instance of Activity. In our codebase we used to use old implementation with executor and it was handled in data layer that does not have an access to the UI layer, and then it is transformed to kotlin flow. With required Activity it is no longer possible and we will have to violate ViewModel patterns and pass activity through viewModel. AFAIU Activity is required to remove callbacks, my proposal is to add removeVerifyPhoneNumberCallback so we can explicitly remove it without providing instance of activity to the library.

How would you use it?

We transform verifyPhoneNumber to kotlin flow in data layer that does not have an access to UI since we don’t want to violate viewModel patterns, with the new implementation of Firebase auth we have to either violate rules and pass instance of activity through viewModel or we have to do verifyPhone stuff in Fragment or Activity. Both options feel wrong in terms of code quality and testabilty

Tell us how you’d use this feature in your app.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:15
  • Comments:10 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
hexdecimal16commented, Apr 19, 2022

@malcolmdeck It’s been more then a year now any updates?

0reactions
Temirlannncommented, Aug 8, 2022

heey guys, any updates?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Manage User Sessions | Firebase Authentication - Google
Because Firebase ID tokens are stateless JWTs, you can determine a token has been revoked only by requesting the token's status from the...
Read more >
How to Remove Firebase Authentication in Android Studio?
Here, we are going to Remove Firebase Authentication in Android Studio. We are going to remove the firebase project connected to our app....
Read more >
#23 Delete User Activity | Login & Register Android App using ...
#23 Delete User Activity | Login & Register Android App using Firebase Authentication with Database.
Read more >
Firebase Phone Verification verifyPhoneNumber() deprecated ...
8 Answers 8 · Update new dependency implementation 'com.google.firebase:firebase-auth:20.0.0' · Update new code: For send OTP: PhoneAuthProvider.
Read more >
How To Disconnect Firebase From Android Studio - Ralph Seim
Step 3 : Adding Required Firebase UI Dependencies in your project. ... How to Remove Firebase Authentication in Android Studio Project.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found