public async Task LoginUser(string userName, string password) { // SplashScreenManager.ShowDefaultWaitForm("please wait....", "login in progress"); var result = await _firebaseLib.LoginAsync(userName, password); if (!result) { _loginResults?.GetError($"{_firebaseLib.ErrorCode}"); return; } var user = _firebaseLib.GetUser(); var users = await _firebaseLib.GetUsers(); var exits = users?.Count(x => x.LocalId == user.LocalId) ?? 0; if (exits == 0) { await _firebaseLib.AddUser(user); } _loginResults?.GetFirebaseResult(_firebaseLib); }
public async Task GetData() { _user = new List <User>(); var fireBase = new FirebaseLib(); var result = await fireBase.LoginAsync(); if (result) { var user = await fireBase.GetUsers(); foreach (var item in user) { _user.Add(item); } } }