Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

358
Visualizações
Difference between these two formats to open the Whatsapp app from a webpage

I've found two ways to open the Whatsapp app from a webpage,

<a href="whatsapp://send?text=Hello&phone=+1123456789">whatsapp</a>

and

<a href="https://api.whatsapp.com/send?phone=+1123456789&text=Hello">whatsapp</a>

I understand the first one works on phone only but apart from that what are the differences between the two?

In my trials I've found that the api method doesn't always work properly in certain mobile browsers. In some cases it doesn't detect the installed app and takes me to the Appstore to install the app.

Does the first method work across all platforms and browsers?

Is it safe to use JavaScript to detect the platform (desktop or mobile) and then load the appropriate link format?

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

The first approach usually requires the browser / OS to understand how to handle the whatsapp:// protocol. This usually requires some setup beforehand (e.g. registering a protocol in Chrome, or a deep link schema in Android), and the browser / OS will pass the request to whatever app / program can handle it.

The second approach doesn't require any setup, and passes the request to WhatsApp's API directly. This is less likely to completely fail, but as you've seen may have issues on mobile when an app claims it should handle all requests to the domain.

You're better off following WhatsApp's documentation, and using their wa.me domain for a universal link:

Universal links can also include a pre-filled message that will automatically appear in the text field of a chat. Use https://wa.me/whatsappphonenumber/?text=urlencodedtext where whatsappphonenumber is a full phone number in international format and urlencodedtext is the URL-encoded pre-filled message.

Example: https://wa.me/15551234567?text=I'm%20interested%20in%20your%20car%20for%20sale

This will handle all the complexities for you. For example, on Android that URL opens the WhatsApp app, on Windows that universal link redirects to the api.whatsapp.com URL, and Chrome asks if I want to use my installed WhatsApp program for it: dialog to open whatsapp on windows via url

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda