How to create a hyperlink that can be opened in both iOS and Android?


I used standard HTML a tag. It works in iOS, but gives error in Android and app crashes)

Error in Android

Application Error
net::ERR_FILE_NOT_FOUND (file:///android_asset/www/


<p class="greenText">How it works? <a href="">Watch a 2min intro video!</a></p>

I try use this googled solution, not working either

        <p class="greenText">How it works?
          <a class="item" href="#" onclick="'', '_self', 'location=yes'); return false;"> Watch a 2min intro video!</a>

Any help?

1 Like

Install the inapp-browser plugin.

Then something like…

<button ion-button (click)="openUrl()">Open Url</button>

And in your code…

openUrl(){'', '_system'); }

And the inline problem you have with the file not found this is coz you’ve not included http:// or https:// at the beginning.

Thanks! This really cleared my puzzle!

One more question, what is the benefit of using the inApp browser plugin? So the user doesn’t need to jump to another browser to view additional info?

In my case, opening youtube by youtbue app or browser is better than from inApp browser

It can still open via the regular browser, YouTube is perhaps a special case.

The in app browser gives you a nice separation from your actual app eliminating CORS type issues and the user isn’t lifted out of your app.

Look it up. I’m doing it a disservice.

thanks for the explanation! I will give it a try.