Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to use inappbrowser plugin in your application

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 499
    Comment on it

    In this post, you will learn about the cordova-plugin-inappbrowser which provides a web view to display in your application.

    Installing the plugin:

    cordova plugin add cordova-plugin-inappbrowser

    Initializing plugin:
    When cordova.InAppBrowser.open() method is called, it display a web view.

    var ref = cordova.InAppBrowser.open('http://apache.org', '_blank', 'location=yes');

    You can use inappbrowser window if you want to load third party content, because inappbrowser window does not allow to use cordova API. It provides its by default GUI to control.

    cordova.InAppBrowser.open:

    It opens a URL in a new InAppBrowser instance or system browser.

    var ref = cordova.InAppBrowser.open(url, target, options);
    1. ref: It refers to the InAppBrowser window.
    2. url: It is URL that you want to load. If the URL has unicode characters, you can call encodeURI().
    3. target: It is the target in which you want to open the URL. It is by default _self.

    There are three parameters for target:

    • _self: It opens in the cordova webview if the URL in whitelist otherwise opens in inappbrowser.
    • _blank: It opens in the inappbrowser.
    • _system: It opens in the browser window of device.

    4. options: It is optional parameter and by default to location=yes. It is basically to turn the location of inappbrowser on or off.

     

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: