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

1

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

whatsapp://send?text=mensagem

in a <a> tag or window.open in js. But in iOS 10 this stopped working, clicking the link does not execute anything, it does not even open whatsapp.

    
asked by anonymous 05.10.2016 / 16:45

2 answers

2

I was able to resolve this as follows.

On the page that had the button that sent 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 out of action), only when the link was whatsapp: // send. So I tried to send it 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 through Phonegap's Webview, when I sent it to open the default browser it worked:

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

_system makes all the difference as the webview can not open whatsapp.

    
05.10.2016 / 20:48
0

You need to use link You can use only the phone function or just text This will call the app on both android and ios and work yes on 10

If you use wordpress website, I created something to make a floating button on all pages easy by redirecting to the number you want. If you want to check out: WhatsApp Chat WP

    
29.05.2017 / 05:39