Login error while sending message using WhatsApp api C #

when I try to send a message using C # api in whatsApp #, it handles the OnLoginFailed event

and show me the loginFailed message

here is my code

     wa.OnConnectSuccess += () =>
        {
            MessageBox.Show("Connected to whatsapp...");

            wa.OnLoginSuccess += (phoneNumber, data) =>
            {
                wa.SendMessage(to, mes);
                MessageBox.Show("Message Sent...");
            };

            wa.OnLoginFailed += (data) =>
            {
                MessageBox.Show("Login Failed : {0}", data);
            };

            wa.Login();
        };

        wa.OnConnectFailed += (ex) =>
        {
            MessageBox.Show("Connection Failed...");
        };

        wa.Connect();
+4
source share

All Articles