public async void LoadUser() { //this.user = await DependencyService.Get<IFireDb>().getUserProfile(); try { var document = await CrossCloudFirestore.Current .Instance .Collection("users") .Document(DependencyService.Get <IAuth>().getCurrentUserUID()) .GetAsync(); user = document.ToObject <Authenticateduser>(); if (user == null) { return; } if (string.IsNullOrWhiteSpace(user.first_name)) { WelcomeLabel.Text = "Welcome"; } else { WelcomeLabel.Text = "Welcome " + user.first_name; } if (!string.IsNullOrWhiteSpace(user.photo_url)) { profilePicHolder.Source = user.photo_url; } }catch (Exception e) { } }
public async void LoadUser() { //this.user = await DependencyService.Get<IFireDb>().getUserProfile(); try { var document = await CrossCloudFirestore.Current .Instance .Collection("users") .Document(DependencyService.Get <IAuth>().getCurrentUserUID()) .GetAsync(); user = document.ToObject <Authenticateduser>(); } catch (Exception e) { } }
public async void LoadUser() { try { //this.user = await DependencyService.Get<IFireDb>().getUserProfile(); var document = await CrossCloudFirestore.Current .Instance .Collection("users") .Document(DependencyService.Get <IAuth>().getCurrentUserUID()) .GetAsync(); user = document.ToObject <Authenticateduser>(); if (!string.IsNullOrWhiteSpace(user.first_name)) { firstNameInput.Text = user.first_name; } if (!string.IsNullOrWhiteSpace(user.last_name)) { lasttNameInput.Text = user.last_name; } if (!string.IsNullOrWhiteSpace(user.contact)) { phoneInput.Text = user.contact; } if (!string.IsNullOrWhiteSpace(user.address)) { addressInput.Text = user.address; } if (!string.IsNullOrWhiteSpace(user.photo_url)) { remote_pic_url = user.photo_url; profilePicHolder.Source = user.photo_url; } }catch (Exception e) { } }