public async void Handle_Clicked(object sender, System.EventArgs e) { if (_rootName.Text == "" || iconSelected == "") { await DisplayAlert("Oops", "You need to choose a Name and an Icon", "Try Again"); } else { var db = new Database.Firebase(); Console.WriteLine(iconSelected); await db.createConversation(new Model.Conversation() { Name = _rootName.Text, Icon = iconSelected }); var oauthToken = await SecureStorage.GetAsync("oauth_token"); var person = await db.GetPerson(oauthToken); var _person = person.Key; var _name = person.FullName; //All Conversations var list = await db.getConversationList(); //For loop to add the logged in users conversations into the second list foreach (Model.Conversation conversation in list) { if (conversation.Name == _rootName.Text) { await db.joinConversation2(conversation.Key, _person, _name); await Navigation.PopAsync(); } } } }
public Login() { InitializeComponent(); db = new Database.Firebase(); }