PhoneGap-Open WhatsApp " whatsapp: / / send?"IOS 10

Until the latest version of iOS 9 when I wanted to share something by whatsapp I could use the link:

whatsapp://send?text=mensagem

In a <a> or window.open tag in js. But in iOS 10 this stopped working, when you click on the link it does not perform anything, does not even open whatsapp.

Author: Guilherme Nascimento, 2016-10-05

2 answers

I managed to solve this as follows.

On the page where there was the button that sends the content to whatsapp, it looked like this:

<a href='whatsapp://send'  data-text='' data-href='http://playfcapp.com.br/gol/?id=".$regis_01['id']."' class='wa_btn wa_btn_l' style='display:none'><div id='social_whatsapp' style='background:url(http://playfcapp.com.br/gol/img/social_whatsapp.png) center center no-repeat #10c246; background-size:contain; height:38px; margin-top:10px;'></div></a>

But not in IOS 10 The Button did not work (it was without action), only when the link was whatsapp://send. Then I tried to send first to a web page where the user would be redirected to whatsapp, it did not work because the app tried to open this page by PhoneGap Webview, when I sent to open by default browser ai worked:

window.open('"endereço da página de redirecionamento"', '_system', 'location=no'); 

_system makes all the difference as webview cannot open whatsapp.

 2
Author: Jefferson Augusto Lopes, 2016-10-05 18:48:23

You need to use https://api.whatsapp.com/send?phone=seu-numero&text=texto-que-deseja It is possible to use only the phone function or only text This will call the app on both android and ios and works yes on 10

If you use wordpress site, I created something to leave a floating button on all pages easily already redirecting to the number you want. If you want to check out: WhatsApp chat WP

 0
Author: Alexandre Caporal, 2017-05-29 03:39:15