Ionic-native: No way to use InAppBrowser in ionic 1

Created on 18 Jan 2017  路  6Comments  路  Source: ionic-team/ionic-native

When trying to use $cordovaInAppBrowser.open() it does nothing and only outputs:

Native: Your current usage of the InAppBrowser plugin is depreciated as of [email protected]. Please check the Ionic Native docs for the latest usage details.

How are we supposed to use it in ionic 1.x if the object is created elsewhere?

Most helpful comment

Thanks, this works perfectly!

I've actually tried that before but without the new keyword and was frustrated that it didn't work. I feel very dumb right now.

All 6 comments

I thought deprecated means "it works but will be removed soon". The message is misleading.

Sorry for the misleading message. I will get rid of it.

Try this:

var ref = new $cordovaInAppBrowser('https://google.com');

Thanks, this works perfectly!

I've actually tried that before but without the new keyword and was frustrated that it didn't work. I feel very dumb right now.

Please add this
var ref = new $cordovaInAppBrowser('https://google.com');

somewhere in the main ionic documentation. Spent like 2h to solve this issue :(

@ihadeed , how to pass the option object to $cordovaInAppBrowser?
This open the browser
var ref = new $cordovaInAppBrowser('https://google.com');
but this is not opening the browser
var ref = new $cordovaInAppBrowser('https://google.com', '_blank,', {location:"no", toolbar:"no"});

Thank you very much.

Ok I answer myself, the new syntax receive an option string instead the object
'location=no,toolbar=no,...'

Was this page helpful?
0 / 5 - 0 ratings