0

Assuming that I called a webpage using a Flutter webview plugin. The webpage code are as follows :

<button onclick="window.open('https://api.whatsapp.com/send?phone=60175XXXX','_system');"><i class="fa fa-whatsapp"></i> Whatsapp</button>

When I clicked on the button, it redirects to ERR_UNKNOWN_URL_SCHEME because the link pointed to whatsapp:// , not https:// .

I am trying not to adjust the Flutter code, by not following the Android WebView err_unknown_url_scheme . I just want to use Javascript inside the webpage to open the mobile browser.

Already tried to use '_blank' or target='_system', but it doesn't work.

"window.open('https://api.whatsapp.com/send?phone=60175XXXX','_blank');"

<a href="https://www.google.com/" target='_system'>...</a>

Any helps? Thank you.

My question might be similar with this one, but the answer doesn't help much. How to open a window(poup) on mobile browser from inside a webview using javascript?

Haizad Annuar
  • 149
  • 1
  • 3
  • 14
  • I am not sure about the Flutter. But in React Native we use linking / deep link to do that. Maybe you can check for that – markcc Jul 18 '20 at 08:31
  • Thank you sir. I ended up adjusting the Flutter code. Already tried to follow https://stackoverflow.com/a/35119754/7228432 , but it doesn't work. – Haizad Annuar Jul 19 '20 at 16:09

0 Answers0