Remove dependency on Activity for Firebase Authentication
See original GitHub issueWhat 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:
- Created 3 years ago
- Reactions:15
- Comments:10 (2 by maintainers)
Top GitHub Comments
@malcolmdeck It’s been more then a year now any updates?
heey guys, any updates?