Example #1
0
        async void OnRegistration(object sender, System.EventArgs e)
        {
            var result = await rest.Register(nameEntry.Text, emailEntry.Text, passwordEntry.Text, postcodeEntry.Text, userSegment.SelectedSegment.ToString(), "1234567");

            if (result != null)
            {
                if (!string.IsNullOrEmpty(result.deviceID))
                {
                    App.Current.Properties["isRegistered"] = true;
                    App.Current.Properties["DID"]          = result.deviceID;
                    Debug.WriteLine("device -----", result.deviceID);
                    await Navigation.PushAsync(new BreatheKlerePage());
                }
                else if (!string.IsNullOrEmpty(result.error))
                {
                    await DisplayAlert("Error", result.error, "OK");
                }
                else
                {
                    await DisplayAlert("Error", "Unknown error", "OK");
                }
            }
            else
            {
                await DisplayAlert("Error", "Error on signing up", "OK");
            }
        }