How to open an external link in an ionic application

Anyone have an idea on how to open an external link (outside my ionic application) in my ionic application. when I follow the link, it will show my application if exsist on a mobile phone.

enter image description here

+6
source share
5 answers

To open a link with your application, you can use the custom-url-scheme cordova plugin. This allows you to open the application using an external link, for example testapp://path?foo=bar . Here is the link https://github.com/EddyVerbruggen/Custom-URL-scheme

+4
source

Install InAppBrowser:

 ionic cordova plugin add cordova-plugin-inappbrowser npm install --save @ionic-native/in-app-browser 

Call your links as follows:

 window.open(url, '_system'); 
+2
source

You can install Cordova and Ionic Native plugins: Browser tab.

 ionic cordova plugin add cordova-plugin-browsertab npm install --save @ionic-native/browser-tab 

and

 import { BrowserTab } from '@ionic-native/browser-tab'; constructor(private browserTab: BrowserTab) { browserTab.isAvailable() .then(isAvailable => { if (isAvailable) { browserTab.openUrl('https://ionic.io'); } else { // open URL with InAppBrowser instead or SafariViewController } }); } 

Look here

0
source

As described here https://ionicframework.com/docs/native/in-app-browser/ :

Install Cordova and Ionic Native plugins:

 $ ionic cordova plugin add cordova-plugin-inappbrowser $ npm install --save @ionic-native/in-app-browser 

using

 constructor(private iab: InAppBrowser) { } const browser = this.iab.create('https://ionicframework.com/'); // browser.show(), browser.close() 
0
source

Install the application in the browser.

 cordova plugin add cordova-plugin-inappbrowser 

Use window.open for this

 <a href="#" onclick="window.open('https://www.google.com/', '_system', 'location=yes');" >Google</a> 

Send link http://intown.biz/2014/03/30/cordova-ionic-links-in-browser/

-1
source

Source: https://habr.com/ru/post/1260918/


All Articles