Solution 1 :
In simple situation :
If your firebase UI is in one Activity and only being used for login then
to be precise the answer is NO. Because most of the Data handling stuff is being done by the Firebase API so that the authentication or authorization will be done. But keep in mind that Device Rotaion will reset the Firebase UI .
In Complex Android app development :
And the answer is YES because Viewmodel is really nedded for firebase UI to communicate with other components in android like fragments & activities which are lifecycle aware. SO that he data returned by the UI will be retained.
Problem :
I have an small question about FirebaseUI
Does FirebaseUI for firestore needs ViewModel? or firebase automatically handles this for us?
although firebaseUi provides paging and recyclerviewadapter built it functions and class.
Comments
Comment posted by nirazverma
while using navigation component with FirebaseUI does i need to add ViewModel class in my project?
Comment posted by P Sekhar
YES you do need to add viewModel to your project.