Sending message through WhatsApp

前端 未结 23 2673
萌比男神i
萌比男神i 2020-11-22 09:42

Since I found some older posts, that tell that whatsapp doesn\'t support this, I was wondering if something had changed and if there is a way to open a whatsapp \'chat\' wit

23条回答
  •  说谎
    说谎 (楼主)
    2020-11-22 10:16

    You'll want to use a URL in the following format...

    https://api.whatsapp.com/send?text=text
    

    Then you can have it send whatever text you'd like. You also have the option to specify a phone number...

    https://api.whatsapp.com/send?text=text&phone=1234
    

    What you CANNOT DO is use the following:

    https://wa.me/send?text=text
    

    You will get...

    We couldn't find the page you were looking for

    wa.me, though, will work if you supply both a phone number and text. But, for the most part, if you're trying to make a sharing link, you really don't want to indicate the phone number, because you want the user to select someone. In that event, if you don't supply the number and use wa.me as URL, all of your sharing links will fail. Please use app.whatsapp.com.

提交回复
热议问题