public async Task<bool> SaveBook() { // save to some db using (SQLiteConnection conn = new SQLiteConnection(App.DatabasePath)) { conn.CreateTable<Book>(); int rowsInserted = conn.Insert(this); Dictionary<string, string> keyValuePairs = new Dictionary<string, string> { { "book_info", ToString() }, { "network", "Cellular" } }; AppCenterHelper.TrackEvent("book_saved", keyValuePairs); return rowsInserted > 0; } //try //{ // await client.GetTable<Book>().InsertAsync(this); // return true; //} //catch(MobileServiceInvalidOperationException msioe) //{ // var response = await msioe.Response.Content.ReadAsStringAsync(); // return false; //} //catch (Exception ex) //{ // return false; //} }
public bool SaveBook() { // save to some db Dictionary <string, string> keyValuePairs = new Dictionary <string, string> { { "book_info", ToString() }, { "network", "Cellular" } }; AppCenterHelper.TrackEvent("book_saved", keyValuePairs); return(true); }
async void LoginButton_Clicked(object sender, System.EventArgs e) { try { //TODO: adding login Dictionary <string, string> keyValuePairs = new Dictionary <string, string> { { "user", "*****@*****.**" }, { "network", "WiFi" } }; AppCenterHelper.TrackEvent("logged_in", keyValuePairs); await Navigation.PopModalAsync(true); } catch (Exception ex) { Dictionary <string, string> keyValuePairs = new Dictionary <string, string> { { "Signal", "Strong" }, { "NewUser", "False" }, { "WiFi", "On" } }; AppCenterHelper.TrackError(ex, keyValuePairs); } }
async void AddNewBook_Clicked(object sender, System.EventArgs e) { AppCenterHelper.TrackEvent("add_book_intent"); await Navigation.PushAsync(new NewBookPage()); }
async void LoginButton_Clicked(object sender, System.EventArgs e) { AppCenterHelper.TrackEvent("login_intent"); await Navigation.PushModalAsync(new LoginPage()); }