Hybrid app: Sharing a link via Whatsapp

1
Hi, Currently I am developing a hybrid app. This app has a page with links (dynamic and stored in attributes) which I want to be able to share via Facebook, Facebook Messenger and Whatsapp. I therefore created buttons on a page; each of them opens a link (resp. https://www.facebook.com/sharer/sharer.php?u={URLtoApplication}, fb-messenger://share/?link={URLtoApplication}, whatsapp://send?text=hello). I have to different issues:  facebook (first link) opens a login page in browser, instead I would like to open the facebook app if available on the user's phone if I click on the last two links I get the same error for both. It says that the web page can not be loaded because:  net::ERR_UNKNOWN_URL_SCHEME   Does anyone have an idea on how I can solve these two problems?  Things I have already tried (mainly for the second issue) and, unfortunately did not help were: - change the link to https://api.whatsapp.com/send?text=hello and http://api.whatsapp.com/send?text=hello for whatsapp - created a page with a URL redirect to the link (both https://api.whatsapp and whatsap://send?text) - created an html-snippet with href to the beforementioned urls - pasted these links in chrome, and it shows a whatsapp page with the message to be send. So the urls should be valid  
asked
2 answers
0

Are you able to change your config.xml to add the following?

<access origin="whatsapp:*" launch-external="yes" />
<access origin="fb-messenger:*" launch-external="yes" />

 

answered
0

Thanks, it got me a bit further than where I got stuck. If I now click on the whatsapp button in the hybrid app it shows me the same page when I enter the URL to my desktop browser; it's a page which shows a preview of the message I am sending and it has a button to send the message. But when click that button, I am shown another page which states ‘Looks like you don't have Whatsapp installed!’ and a download Whatsapp button. For the record, I do have Whatsapp on my phone, so it looks like the hybrid app can't find it somehow. 

answered