Skip to main content

Open urls using InAppBrowser plugin in Ionic Apps

· One min read

How to open urls using InAppBrowser plugin & window.open from ionic3+ apps. We can InAppBrowser plugin & window.open for opening urls from ionic3+ app

Steps

  1. Install below plugins ionic cordova plugin add cordova-plugin-inappbrowser

npm install --save @ionic-native/in-app-browser

  1. Add InAppBrowser in the app.module.ts
import { InAppBrowser } from '@ionic-native/in-app-browser';
import { LaunchUrlProvider } from '../providers';

@NgModule({   declarations: \[     // ...   \],  
imports: \[     BrowserModule,     IonicModule.forRoot(MyApp),     IonicStorageModule.forRoot()   \],  
bootstrap: \[IonicApp\],  
entryComponents: \[     // ...   \],  
providers: \[     // ...    
InAppBrowser,     LaunchUrlProvider   \] })
  1. Create a LaunchUrlProvider

  2. Inject it in your Page/Componet and call the methods