WhatsappAPI icon indicating copy to clipboard operation
WhatsappAPI copied to clipboard

Create new chat

Open BaukaKZ opened this issue 7 years ago • 4 comments

Hello! I can't send a message to my contact. I have it in my contacts core.contact shows a contact, but core.chat gives null. if you write to the contact from the phone and then look again at core.chat only then it is not null

BaukaKZ avatar Jan 30 '19 08:01 BaukaKZ

Thank you all! I found a solution. Who is interested here is an example:

var id = new window.Store.UserConstructor("[email protected]");
Store.Chat.find(id).then(function(chat) {
    chat.markComposing();
    chat.sendMessage("....");
});

you can write to contacts that you do not have in your phone

BaukaKZ avatar Jan 31 '19 06:01 BaukaKZ

How u made this work? create a page and executed on browser?

gabrielpotumati avatar Apr 05 '19 20:04 gabrielpotumati

@BaukaKZ did you use the store hotfix? I'm unable to use chat.sendmessage() (https://github.com/yotam180/WhatsappAPI/issues/56) Would love to know how you got that working!

Ashwinning avatar Jul 11 '19 16:07 Ashwinning

window.Store.UserConstructor("[email protected]");

Did you solve the problem, I am facing the same, would you post whatever solution you have here? , please.

Nassirama avatar Sep 21 '19 10:09 Nassirama