0

How can we call external URL inside our worklight hybrid application? We are calling it through window.open but we want to open it in InAppbrowser. Does it need to install Cordova plugin "cordova-plugin-inappbrowser" ?

We have MFPF 7.1

can someone please advise what steps we need to follow.

Thanks,

MichealSmith
  • 183
  • 1
  • 2
  • 9

1 Answers1

2

IBM MFP 7.1 has cordova and the major cordova plugins embedded. This means when you create an MFP 7.1 hybrid project, certain plugins are already present for your use directly. The complete list of available plugins can be found in this document : https://mobilefirstplatform.ibmcloud.com/tutorials/en/foundation/7.1/hello-world/integrating-mfpf-sdk-in-cordova-applications/ .

You will find that among others, inappbrowser is also automatically added to your hybrid project. This means you can directly use :

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

or set existing window.open to inappbrowser like this :

window.open = cordova.InAppBrowser.open;

More usage info on inappbrowser can be found on the official cordova browser over here : https://cordova.apache.org/docs/en/latest/reference/cordova-plugin-inappbrowser/

Keerthi
  • 423
  • 3
  • 9