Does anyone know of any examples that use Firebase Authentication in pure compose? I'm having a dif...
b
Does anyone know of any examples that use Firebase Authentication in pure compose? I'm having a difficult time building it from scratch without finding any concrete examples as the examples all(including docs) utilize multiple activities, xml, & have deprecated functions (i.e
onActivityResult
). Perhaps it's better to interop and utilize multiple acitivites and break the app from being pure Compose? Any guidance/advice is greatly appreciated!
i
FWIW, the Activity Compose artifact allows you to use the Activity Result APIs from Compose (via the just recently renamed
rememberLauncherForActivityResult()
method), which is what allows you to do `startActivityForResult()`/`onActivityResult()` all within your Composable
āž• 2
c
I’m not using Firebase Auth, but I am using AppAuth + the activity result APIs: https://github.com/chrisbanes/tivi/blob/main/ui-account/src/main/java/app/tivi/account/AccountUi.kt#L86
b
Thanks Ian & Chris. Perhaps I'm a bit ahead of myself on this one. Been stumped on it for the past week & may just wait until some samples come out on github before continuing with login/authorization. I'll try using auth outside of Compose until then. Appreciate the help!! šŸ˜Šāž•
i
Maybe try playing around with the Activity Result API outside of Compose, following the guide (https://developer.android.com/training/basics/intents/result), and then adapt that code to Compose afterwards. That'll help you break your dependency on `startActivityForResult()`+
onActivityResult()
šŸ™‡ā€ā™‚ļø 1
āž• 1