1

I use whatsapinet api enter link description here To send message with C# ( asp.net web form) Now when I create new group with sendcreategroup() method I can't receive gjid in wa_OnGetGroupSubject delegate ! In fact wa_OnGetGroupSubject does not run when creating group

This is my code : (write is a function for log in txt file)

        protected void btnShowGroups_Click(object sender, EventArgs e)
    {
        string s=  ((Button)sender).CommandArgument;
        string[] si = s.Split(',');
        string UsenName = si[0];
        string Pass = si[1];

        WhatsAppApi.WhatsApp wa = new WhatsAppApi.WhatsApp(UsenName, Pass, si[2], true);

        wa.OnLoginSuccess += wa_OnLoginSuccess;
        wa.OnLoginFailed += wa_OnLoginFailed;
        wa.OnGetGroupSubject += wa_OnGetGroupSubject;
        wa.OnGetGroups += wa_OnGetGroups;
        wa.OnGetGroupParticipants += wa_OnGetGroupParticipants;

        string datFile = getDatFileName(UsenName);
        byte[] nextChallenge = null;
        if (File.Exists(datFile))
        {
            try
            {
                string foo = File.ReadAllText(datFile);
                nextChallenge = Convert.FromBase64String(foo);
            }
            catch (Exception) { };
        }

        wa.Connect();
        wa.Login(nextChallenge);

        //event binding
        wa.SendCreateGroupChat("MoHaMmAdq12");


    }

    public void wa_OnGetGroupParticipants(string gjid, string[] jids)
    {
        write("Got participants from " + gjid + ":");
        foreach (string jid in jids)
        {
            write("\t" + jid + "");
        }
    }

    public void wa_OnGetGroups(WaGroupInfo[] groups)
    {
        write("Got groups:");
        foreach (WaGroupInfo info in groups)
        {
            write("\t" + info.subject + " " + info.id + "");
        }
    }

    private void wa_OnGetGroupSubject(string gjid, string jid, string username, string subject, DateTime time)
    {
        write("gjid" + gjid);
        write("jid"+jid);
        write("username" + username);
        write("subject"+subject);

    }
Rikesh
  • 26,156
  • 14
  • 79
  • 87
mohammad
  • 275
  • 3
  • 16

0 Answers0