---
updatedAt: 2025-07-15T08:43:29.000Z
agentTools:
  projectIndex: https://docs.appery.io/llms.txt
---

# Ionic InAppBrowser App Tutorial

Using the InAppBrowser API in an Ionic app

# Introduction

In this tutorial, you’ll learn how to [build an Ionic app](https://appery.io/appbuilder) that navigates to a web page via various methods of the **Apache Cordova**API as a preconfigured native service. The **InAppBrowser** plugin provides the ability to spawn a browser instance from the application.

The app will look like this:

<Image align="center" className="border" width="30% " border={true} src="https://files.readme.io/1f932d8-small-2023-05-09_12-52-56.png" />

> 📘 Want to know more?
>
> To learn more about the component, and any other settings and options, please go to the [InAppBrowser documentation page](https://cordova.apache.org/docs/en/10.x/reference/cordova-plugin-inappbrowser/index.html).

# Creating App

First, let\`s [create a new app](https://docs.appery.io/docs/1-creating-an-app-ui-palette#creating-new-app) in the **[App Builder](https://appery.io/appbuilder)**.\
From the **[Apps](https://appery.io/app/projects)** tab, click the **Create new app** button, select **[Ionic Blank](https://docs.appery.io/docs/ionic-5-app-templates#ionic-5-blank)**, then enter an app name and click **Create**.

# Creating App UI

1. First, open the **Screen 1[DESIGN](https://docs.appery.io/docs/apperyio-visual-builder#design-panel)** panel and to make the app UI more well-round, click on the **[Toolbar title](https://docs.appery.io/docs/toolbar#toolbar-title)** in the app screen and change it to ***Ionic InApp Browser App*** by changing the **Text** property under the **[PROPERTIES](https://docs.appery.io/docs/1-creating-an-app-ui-palette#properties-overview)** panel menu:

<Image align="center" className="border" border={true} src="https://files.readme.io/993ce2a-small-2023-05-09_12-52-07.png" />

2. Now, select the **[Page](https://docs.appery.io/docs/screens-and-tabs#pages-screens)** component from the breadcrumbs (you can also use the **[OUTLINE](https://docs.appery.io/docs/creating-app-ui-palette#outline-view)** view to locate the needed component) and set the page **[Footer](https://docs.appery.io/docs/2-creating-an-app-ui-pages-and-tabs#properties-1)** property to ***False*** as we will not use it in the app (you will also be asked to confirm changing the property).
3. Now, drag the **[Input](https://docs.appery.io/docs/input)** component to the editor.
4. Under the **[PROPERTIES](https://docs.appery.io/docs/1-creating-an-app-ui-palette#properties-overview)** panel menu, change its **Placeholder** property to ***Enter URL*** and set its **Item Wrapped** property to ***False***. Also, set ***url*** as the **\[(ngModel)]** property of the **[Input](https://docs.appery.io/docs/input)** component:

<Image align="center" className="border" border={true} src="https://files.readme.io/b10bc9a-small-2023-05-09_12-54-19.png" />

5. Now, place the **[RadioGroup](https://docs.appery.io/docs/radiogroup)** component and set the following parameters for each **[Radiobutton](https://docs.appery.io/docs/radiobutton)**:

* For **[Radiobutton](https://docs.appery.io/docs/radiobutton)**&#x31;, type In ***App Browser*** for its **Label > Text** property, and define the component's **Value** as ***blank***.
* For **[Radiobutton](https://docs.appery.io/docs/radiobutton)**&#x32;: set the **Label > Text** to ***System Browser***, **Value** – to ***system***.
* And for **[Radiobutton](https://docs.appery.io/docs/radiobutton)**&#x33;: set **Label > Text** property to ***Cordova Web View*** and **Value** property to ***self***:

<Image align="center" className="border" border={true} src="https://files.readme.io/ff0ccb8-small-2023-05-09_12-55-33.png" />

6. To finish with the app UI, place the **[Button](https://docs.appery.io/docs/button)** component on the page, then define its **Text** property as ***Open link***:

<Image align="center" className="border" border={true} src="https://files.readme.io/44b1828-small-2023-05-09_12-56-48.png" />

# Defining App Logic

1. Go to **Project > App settings > Cordova plugins** and enable the **InAppBrowser** plugin check box under the **[Core Cordova Plugins](https://docs.appery.io/docs/cordova-overview#core-cordova-plug-ins)** tab:

<Image align="center" className="border" border={true} src="https://files.readme.io/f6ad304-small-2023-05-09_12-58-21.png" />

2. Go back to the **Screen1** page, open its **[CODE](https://docs.appery.io/docs/apperyio-visual-builder#code-panel)** panel, and add two variables - `url` and `type`, both of **String** type:

<Image align="center" className="border" border={true} src="https://files.readme.io/0e60a91-small-2023-05-09_12-59-06.png" />

3. Now, enter ***type*** for the **\[(ngModel)]** property value of the **[RadioGroup](https://docs.appery.io/docs/radiogroup)** component:

<Image align="center" className="border" border={true} src="https://files.readme.io/82269d7-small-2023-05-09_13-03-16.png" />

4. Next, unfold the **[EVENTS](https://docs.appery.io/docs/apperyio-visual-builder#events-tab)** tab from the page bottom, and for the **Open Link** button **[Click](https://docs.appery.io/docs/5-event-handling#common-events)** event, select the ***[Run TypeScript](https://docs.appery.io/docs/5-event-handling#run-typescript)*** from the drop-down list.
5. Then, in the editor, add the following code and save the event:

```typescript
if (( < any > window).cordova) {
  ( < any > window).cordova.InAppBrowser.open(this.url, this.type , 'location=yes');
} else {
   console.log('ok');
}
```

<Image align="center" className="border" border={true} src="https://files.readme.io/80dc758-small-2023-05-09_13-04-16.png" />

6. Click the **SAVE** button in the **App Builder[Toolbar](https://docs.appery.io/docs/#toolbar)** to save the app.

# App Testing

We’re invoking a native Cordova component here, so the app has to be installed on a mobile device to test the In-App Browser functionality.

When your app version is ready, you might also like to [test](https://docs.appery.io/docs/9-testing-your-app) it on the device.

> 👍 Appery.io **Tester App**
>
> A great option to quickly test the app on the device is to use our **Appery.io Tester** app.\
> The app is free and available for both [iOS](https://apps.apple.com/app/id737478069) and [Android](https://play.google.com/store/apps/details?id=io.appery.tester\&hl=en).\
> You can check out [this](https://docs.appery.io/docs/apperyio-tester-app) page to learn more about using the **Appery.io Tester** app.

<Image align="center" className="border" width="50% " border={true} src="https://files.readme.io/b0a49c7-small-2023-05-09_13-07-41.png" />

Also, you can [export](https://docs.appery.io/docs/appexport-overview) the app as an Android binary by clicking **EXPORT > Binary** (both **iOS** and **Android** options are available) in the top menu to [install](https://docs.appery.io/docs/testingandebug-testing-your-app#installing-app-on-a-device) it on the device:

<Image align="center" className="border" width="50% " border={true} src="https://files.readme.io/b7e584f-Export.png" />

Once the build is completed, the file can be downloaded and you can also see the QR code:

<Image align="center" className="border" border={true} src="https://files.readme.io/b76663c-small-2023-05-09_13-11-35.png" />

Here is how the app performs on an Android device:

> 👍 Important Note!
>
> Please note that you will need to generate the [iOS certificate](https://docs.appery.io/docs/appexport-ios#generating-ios-certificates) with the [In-App Purchase capability](https://developer.apple.com/in-app-purchase/) to build an `.ipa` file.\
> You can check [this](https://docs.appery.io/docs/appexport-ios) document in case you need help with exporting your application for iOS.\
> [Here](https://docs.appery.io/docs/appexport-android#android-certificate-file), you will find information on generating certificates for Android.\
> Note as well that starting from *August 2021*, new apps are required to publish with the [Android App Bundle](https://developer.android.com/guide/app-bundle) (`.aab`) on Google Play.\
> Please read more [here](https://developer.android.com/guide/app-bundle).\
> You can also check this Appery.io YouTube video that shows how to create Android and iOS certificates:

<HTMLBlock>{`
<iframe width="610" height="315" src="https://www.youtube.com/embed/aMS4T0snEeA" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
`}</HTMLBlock>