mercredi 29 juillet 2015

not able to send message via whatsapp API using asp.net mvc3

when i'm trying to send a message using c# with whatsApp API ,

it shows login Failed. The error is not-authorized. Please help me. Thanks in advance.

code:

  WhatsApp wa = new WhatsApp(from, "mypassword", "Rajat", false, false);

        wa.OnConnectSuccess += () =>
            {
                TempData["connect"] = "Connected to whatsapp";

                wa.OnLoginSuccess += (PhoneNumber, data) =>
                    {
                        wa.SendMessage(to, msg);
                        TempData["sent"] = "Message Sent";
                    };
                wa.OnLoginFailed += (data) =>
                    {
                        TempData["fail"] = data;
                    };
                wa.Login();
            };

        wa.OnConnectFailed += (ex) =>
            {
                TempData["failure"] = "Connection Failed";
            };

        wa.Connect();

        return View();

Aucun commentaire:

Enregistrer un commentaire