confirmPhoneUpdate method

Future<void> confirmPhoneUpdate(
  1. String phone,
  2. String confirmationCode,
  3. bool smsAgreement, {
  4. required void onSuccess(),
  5. required void onError(
    1. SyneriseError error
    ),
})

The function confirmPhoneUpdate takes in a phone number, confirmation code, and SMS agreement, and calls a private method to confirm the phone update.

Args: phone (String): A string representing the new phone number that the user wants to update to. confirmationCode (String): The confirmation code is a string that is used to verify the phone number update. smsAgreement (bool): A boolean value indicating whether the user has agreed to receive SMS notifications or not.

Implementation

Future<void> confirmPhoneUpdate(
    String phone, String confirmationCode, bool smsAgreement,
    {required void Function() onSuccess,
    required void Function(SyneriseError error) onError}) async {
  SyneriseResult<void> result = await _methods.confirmPhoneUpdate(
      phone, confirmationCode, smsAgreement);

  result.onSuccess((result) {
    onSuccess();
  }).onError((error) {
    onError(error);
  });
}