0

Is there anyway we can trigger send from a mobile web page in chrome to send the image on whatsapp. This seems to be possible if you do a right-click on any image on any webpage, and click share image. How can a user action trigger this.

mdeora
  • 4,152
  • 2
  • 19
  • 29

1 Answers1

-1

It's possible to do this by setting the intent package to com.whatsapp. I suggest you take a look at the Chrome developer guidelines here.

An adaptation of an example from the guideline (you need to adapt the intent to match sending a picture instead of taking a QR code):

<a href="intent://scan/#Intent;scheme=zxing;package=com.whatsapp;end"> Take a QR code </a>
Doron Yakovlev Golani
  • 5,188
  • 9
  • 36
  • 60
  • I checked this, it seems you can just pass the web url or the image, not the image itself as you don't get the local uri of the image temporarily stored by chrome. If you know of this, any snippet would be helpful. – mdeora Aug 28 '18 at 14:25
  • Can't you just take the file from `file:///sdcard/`? I suggest you have a look at https://stackoverflow.com/questions/50111170/android-url-scheme-to-open-file-from-browser-link – Doron Yakovlev Golani Aug 28 '18 at 14:34
  • The images here are the images loaded on the webpage, we don't have them saved on sdcard. the link shared doesn't relate to my case. – mdeora Aug 28 '18 at 14:35