Example #1
0
        private async void btnSendCode_Click(object sender, EventArgs e)
        {
            NumberToSendMessage = tbPhoneNumber.Text;
            if (string.IsNullOrWhiteSpace(NumberToSendMessage))
            {
                return;
            }
            // this is because the contacts in the address come without the "+" prefix
            var normalizedNumber = NumberToSendMessage.StartsWith("+") ?
                                   NumberToSendMessage.Substring(1, NumberToSendMessage.Length - 1) :
                                   NumberToSendMessage;



            client = NewClient();

            await client.ConnectAsync();

            hash = await client.SendCodeRequestAsync(normalizedNumber);

            tbPhoneNumber.Enabled     = false;
            btnSendCode.Enabled       = false;
            tbVerficationCode.Enabled = true;
            btnLoginNew.Enabled       = true;
        }