Mobile website “WhatsApp” button to send message to a specific number

后端 未结 9 1714
小鲜肉
小鲜肉 2020-12-01 02:16

A mobile website can be customized to allow users to share a pre-filled message in WhatsApp to a manually chosen contact. As given here it is done using Custom URL Scheme. A

9条回答
  •  死守一世寂寞
    2020-12-01 02:48

    WhatsApp is now providing a much simpler API https://wa.me/ This isn't introducing any new features, just a simpler way to execute things. There's no need to check for user agent while implementing this API as it will also work with native apps as well as the web interface of whatsapp (web.whatsapp.com) on desktop.

    This can be used in multiple use cases

    • A Click to chat button : Use https://wa.me/whatsappphonenumber to open a chat dialog with the specified whatsapp user. Please note that the whatsappphonenumber should be a valid whatsapp number in international format without leading zeros, '+', '-' and spaces. e.g. 15551234567

      Whatsapp Me

    • A Share this on whatsapp button : Use https://wa.me/?text=urlencodedtext to open a whatsapp contact selection dialog with a preset text. e.g.

      Share on WhatsApp

    • A Contact me button with prefilled text : A combination of the above two, Might be useful if you want to get a prefilled custom message from users landing on a particular page. Use format https://wa.me/whatsappphonenumber/?text=urlencodedtext

      I am interested

    For official documentation visit https://faq.whatsapp.com/en/general/26000030

提交回复
热议问题