rlamasb / Firebase.Xamarin

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

User persistence #38

Open Ramonzo opened 6 years ago

Ramonzo commented 6 years ago

I try to login my users with email and password, I do this for get my user and it's works for now:

options = new FirebaseOptions.Builder()
                .SetStorageBucket(".appspot.com")
                .SetApplicationId("")
                .SetApiKey("")
                .SetDatabaseUrl("https://.firebaseio.com")
                .SetGcmSenderId("")
                .Build();

            app = FirebaseApp.InitializeApp(Android.App.Application.Context, options);
            authProvider = new FirebaseAuthProvider(new FirebaseConfig(options.ApiKey));
firebaseAuth = await authProvider.SignInWithEmailAndPasswordAsync(e, p);
                name.Text = firebaseAuth.User.DisplayName;

But, how I persist this user for get the name or other infos in other page? And the mostly important, how I can close my app and verify if my user is logged when I open again? I using Xamarin.Forms in Cross Platform PS. I hide the options infos.