Phonegap - Open Whatsapp "Whatsapp://send?" IOS 10

Asked

Viewed 1,476 times

1

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

whatsapp://send?text=mensagem

on a tag <a> or window.open no js. But in iOS 10 this stopped working, when clicking on the link it does not run anything, not even open the Whatsapp.

  • But it’s not necessary to create a popup for this, just create a link not? However I don’t have iOS 10 to test :/

  • In Safari browser in iOS 10 the link works?

  • Yes it works! It just doesn’t work inside the application made in Cordova.

  • I get it, so it must be something left to release in webview or permissions, I don’t use Cordova but I’ll try to see if I can find out, post the webView code and permissions please.

  • I switched to not open in webview, but in the default browser, now it opens Whats but does not send the text

  • Without code it’s hard to know exactly what you did

  • I managed to solve, I will put the solution here ![

Show 2 more comments

2 answers

2

I managed to solve it this way.

on the page where there was the button that sends the content to Whatsapp, it was 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 on IOS 10 the button did not work (was without action), only when the link was Whatsapp://send. So 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, because webview cannot open Whatsapp.

0

Browser other questions tagged

You are not signed in. Login or sign up in order to post.