InAppBrowser ionic-native 2.2.6 - ionic 2


#1

Hi,
have you anybody working InAppBrowser on ionic-native 2.2.6? If I use implementation by docs it tells me that this implementation is depreciated…

my function is:

linkTo(url) {

    InAppBrowser.open(url, '_system');
    return false;
}

and whole warning:
Native: Your current usage of the InAppBrowser plugin is depreciated as of ionic-native@1.3.8. Please check the Ionic Native docs for the latest usage details.

Thanks for help


#2

Yes, that method is depreciate, and will be removed from the docs soon.


#3

Ok. So can you give some example how to open url in inAppBrowser?

Thanks


#4

The docs you are linking to tells you to use the plugin like this:

import {InAppBrowser} from 'ionic-native';


...


let browser = new InAppBrowser('https://ionic.io', '_system');
browser.executeScript(...);
browser.insertCSS(...);
browser.close();

#5

Ok.

If I use

linkTo(url) {
    let browser = new InAppBrowser(url, '_system', "location=true");
}

Than the link is opened in chrome. But no InAppBrowser…


#6

To open in InAppBrowser, change 2nd param from _system to _blank.


#7

Thanks a lot. Works perfectly.