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
- Install below plugins ionic cordova plugin add cordova-plugin-inappbrowser
npm install --save @ionic-native/in-app-browser
- 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 \] })
-
Create a LaunchUrlProvider
-
Inject it in your Page/Componet and call the methods