示例#1
0
        public async Task SendVerifyCode(string code)
        {
            IInstaApi api = await GetApi();

            await api.LoginAsync();

            await api.GetVerifyStep();

            await api.ChooseVerifyMethod(0);

            await api.GetVerifyStep();

            IResult <InstaResetChallenge> result = await api.SendVerifyCode(code);

            if (!result.Succeeded)
            {
                throw new OdkServiceException(result.Info.Message);
            }
        }
示例#2
0
        async void HandleChallenge(bool resend = false)
        {
            try
            {
                IResult <InstaResetChallenge> challenge = null;
                if (!resend)
                {
                    challenge = await api.GetVerifyStep();
                }
                else
                {
                    challenge = await api.ResetChallenge();
                }
                if (challenge.Succeeded)
                {
                    if (challenge.Value.StepData != null)
                    {
                        if (!string.IsNullOrEmpty(challenge.Value.StepData.PhoneNumber))
                        {
                            if (!resend)
                            {
                                radioPhone.Checked = false;
                            }
                            radioPhone.Text = challenge.Value.StepData.PhoneNumber;
                        }
                        if (!string.IsNullOrEmpty(challenge.Value.StepData.Email))
                        {
                            if (!resend)
                            {
                                radioMail.Checked = false;
                            }

                            radioMail.Text = challenge.Value.StepData.Email;
                        }
                    }
                }
                else
                {
                    MessageBox.Show(challenge.Info.Message, "ERR");
                }
            }
            catch (Exception ex) {  }
        }