rlamasb / Firebase.Xamarin

Light weight wrapper for Firebase Realtime Database REST API.
MIT License
149 stars 39 forks source link

login never returns #24

Open muehan opened 7 years ago

muehan commented 7 years ago

Hi

I use version 0.3.6 from nuget.

If I try to login

 FirebaseAuthProvider authProvider = new FirebaseAuthProvider(new FirebaseConfig("MyAPIKeyHere"));
 FirebaseAuthLink user = await authProvider.SignInWithEmailAndPasswordAsync("email", "password");

it the sign in never returns. No error message, debugger waits and waits and waits

Ramonzo commented 7 years ago

For make the login you can try this:

//In my main class
options = new FirebaseOptions.Builder()
                .SetStorageBucket("</database>.appspot.com")
                .SetApplicationId("appid")
                .SetApiKey("apikey")
                .SetDatabaseUrl("https://</database>.firebaseio.com")
                .SetGcmSenderId("gcmsenderid")
                .Build();
            //For android context
            app = FirebaseApp.InitializeApp(Android.App.Application.Context,options);
            authProvider = new FirebaseAuthProvider(new FirebaseConfig(options.ApiKey));

//I put this into a async task function
firebaseAuth = await authProvider.SignInWithEmailAndPasswordAsync(</email>, </pass>);

Now I can trying to get persistence user login, but I not sure if this works.