Exemplo n.º 1
0
        private async Task OnVerify()
        {
            try
            {
                IsBusy = true;

                VerifyCodeQueryContext verficationContext = new VerifyCodeQueryContext
                {
                    Code = _verificationCode,
                    VerificationCodeId = _confirmationGuid
                };
                var verifyUserPhoneNumber = await Api.VerifyUserPhoneNumber(verficationContext);

                if (!verifyUserPhoneNumber.Successful.GetValueOrDefault() || verifyUserPhoneNumber.ValidationErrors.Any())
                {
                    await Alert.DisplayApiCallError(verifyUserPhoneNumber.ExceptionMessage, verifyUserPhoneNumber.ValidationErrors);

                    return;
                }

                if (verifyUserPhoneNumber.Data.GetValueOrDefault())
                {
                    await Alert.ShowMessage(nameof(AppResources.PhoneNumberChanged).Translate());

                    await Nav.Nav.PopAsync();
                }
                await Alert.ShowMessage(nameof(AppResources.VerificationCodeIsInvalid).Translate());
            }
            catch (Exception e)
            {
                await Alert.DisplayError(e);
            }
            finally
            {
                IsBusy = false;
            }
        }
Exemplo n.º 2
0
 public async Task <ApiResponseOfBoolean> VerifyUserPhoneNumber(VerifyCodeQueryContext context)
 {
     return(await AXClient.Instance.VerifyUserPhoneNumberAsync(context)
            .ConfigureAwait(false));
 }