2
votes

"Trying to send whatsapp message automatically, pre-filled message in the code, that will automatically appear in the text field of a whatsapp chat, But the user needs to click the send button.Is there is any way to send whatsapp message automatically.I tried most of the same questions in the stack overflow.But i cant find any solution"

sendmessage.setOnClickListener(new View.OnClickListener() {
    @Override
    public void onClick(View v) {

        Intent intent = new Intent();    
        intent.setData(Uri.parse(
            "https://api.whatsapp.com/send?phone="
            + ccp.getFullNumberWithPlus() + enternumber.getText()
            + "&text=" +msg.getText()
        ));
        startActivity(intent);
    }
});
1
I think this is not working intentionally - davidev
No, WhatsApp doesn't provide such features. Mostly because of potential Spam and security reasons. Even Android canceled some SMS features because of the reasons mentioned above. Many Apps where removed from the PlayStore 2 years ago. - TheScribbler2019
It's not possible. It would be abused by scammers if it was. It would essentially allow anyone to get your WhatsApp to message anyone else without confirmation revealing your phone number. - Philio
But there is a whatsapp reminder app.How it is possible in that app? @davidev @ - Jithin MSs
@JithinMSs They are sending messages from your Account or you receive messages from them? - davidev

1 Answers

1
votes

just use

from selenium.webdriver.common.keys import Keys

and then your message variable to write the message

the code to writhe the mesage: .send_keys("message") /you could also send the message variable

the code to send the mesage/press enter: .send_keys(Keys.RETURN)

alright now go write it now