InAppBrowser not working on android

I’ve installed the plugin via “cordova plugin add cordova-plugin-inappbrowser” and had success on an iOS build opening up a website with window.open(‘https://google.com’, ‘_self’) as an init action on a controller.

Android just leaves a blank screen without any errors.

I’ve seen a couple of solutions suggesting adding a gap:plugin entry to the config.xml, but those have resulted in build errors. I think this may have to do with those other solutions being applicable to an earlier version of ionic.

The index.html file looks like this:

 <ion-pane>
  <ion-header-bar class="bar-stable" ng-controller="HeaderBarController">
    <h1 class="title">{{appTitle}}</h1>
  </ion-header-bar>
  <ion-content ng-controller="AppController" ng-init="openWebsite()" padding="true">
  </ion-content>
</ion-pane>

and the openWebsite() function looks like this:

$scope.openWebsite = function()
{
window.open(‘https://google.com’,’_self’);
};

Am I missing something here?

EDIT: The blank screen happens just the same on the Android emulator and on an Android phone.

The use of <gap: in the config.xml is for use with PhoneGap Build and not the Ionic CLI. Please remove it from your config.xml file

You need to look at the Whitelist plugin and it’s settings: http://docs.ionic.io/docs/cordova-whitelist

That is the probable source of your issue.

Chris

Chris,

Thanks for the heads up. It certainly was the whitelist settings. I appreciate the quick response.