f-miyu / Plugin.FirebaseAuth

MIT License
61 stars 26 forks source link

Plugin.FirebaseAuth.FirebaseAuthException: An error occurred when accessing the keychain #30 #35

Open ourweb4 opened 3 years ago

ourweb4 commented 3 years ago

I am getting this error when i create a new user. however the user is created, I don not know how to fix this issue. the following is my code. var result = await CrossFirebaseAuth.Current.Instance.CreateUserWithEmailAndPasswordAsync(em, pw); var uid = result.User.Uid; if (uid != null) { User user = new User(); var app = Application.Current as App; app.ukey = uid; user.Uid = uid; user.address = txtaddress.Text; user.city = txtcity.Text; user.email = em; user.first = txtfirstname.Text; user.phone = txtphone.Text; user.state = txtstate.Text; user.zip = txtzip.Text; user.last = txtlastname.Text; await CrossCloudFirestore.Current .Instance .Collection("users")

                         .AddAsync<User>(user);

                    await Navigation.PushModalAsync(new ToolPage());
                }
                else
                {

                    await DisplayAlert("Error", "User cant be created ", "OK");
                }
                }
    catch (Exception ex)

            {
                await DisplayAlert("Error", ex.Message, "OK");

            }
        }
        else
        {
           await  DisplayAlert("Error", "Email/password cant be blank", "OK");
        }
rezamohamed commented 2 years ago

Make sure you have a provisioning profile created on your apple developer account, and its on xcode in your local machine. Then, in Entitlements, enable keychain access. in iOS Bundle Signing, in custom entitlements, add this Entitlements.plist file.

UNARDanielPratt commented 2 years ago

Visual Studio only adds the entitlements.plist to the iPhone platform, you also need to add it to the iPhoneSimulator platform in iOS Bundle Signing if you want to test it on the simulator instead of a physical device.