GitLiveApp / firebase-java-sdk

A pure java port of the Firebase Android SDK
Apache License 2.0
16 stars 5 forks source link

Error with auth user creation #17

Open kuromiichi opened 1 month ago

kuromiichi commented 1 month ago

I am trying to use auth.createUserWithEmailAndPassword() in my common code and everything seems fine, but when I call the method I get this error:

Exception in thread "DefaultDispatcher-worker-1" kotlin.NotImplementedError: An operation is not implemented.
    at com.google.firebase.auth.FirebaseAuth.createUserWithEmailAndPassword(FirebaseAuth.kt:429)
    at dev.gitlive.firebase.auth.FirebaseAuth.createUserWithEmailAndPassword(auth.kt:58)
    at ui.screens.settings.SettingsViewModel$onDialogRegisterClick$1.invokeSuspend(SettingsViewModel.kt:131)
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
    at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:104)
    at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:585)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:802)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:706)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:693)
    Suppressed: kotlinx.coroutines.internal.DiagnosticCoroutineContextException: [StandaloneCoroutine{Cancelling}@108d9c4b, Dispatchers.Default]

I am targeting Android and JVM. I hoped sign in and user creation would be implemented, is it not the case?

murfel commented 3 weeks ago

@kuromiichi sounds like a small typo could be the reason for this. I've made a small example of using Firebase Auth via GitLive's Firebase SDK with iOS and Android. You could use this as a starter template or just to compare notes. Does it help to solve your problem?

https://github.com/murfel/kmp-ios-android-firebase-auth

nbransby commented 3 weeks ago

It's not implemented as stated in the readme, but it's probably fairly easy to add if you want to submit a PR you can look at the implementation of signInUserWithEmailAndPassword and the API docs for the FirebaseAuth REST API