Start WhatsApp from URL HREF with custom text/content

前端 未结 7 1806
醉酒成梦
醉酒成梦 2020-12-24 13:47

As you know using the whatsapp url scheme on iphone i can create the following link:

href=\"whatsapp://send?text=blahblah\"

this is possibl

7条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-24 14:33

    I think the answer you where looking for is this:

    Whatsapp me please
    

    This code works both in Android and iOS thanks to the parameters "phone" and "abid" respectively.

    Update: If the user uses the web app, that link will do nothing. What I do is to provide that link for mobile and this other one for desktop users:

    Whatsapp me please
    

    You can do it through a CSS @mediaquery or just making the domain dynamic.

    The reason why I use two different methods instead of the API "wa.me/?text=menssage", is to avoid the user a hard time trying to open whatsapp aswering questions he probably don't cares about.

    Sorry for the late response, hope it helps somebody anyway.

提交回复
热议问题