2

I am developing an application using IBM Worklight 6.2.

The WL.App.OpenURL method is not working in BlackBerry 10 but does work in other environments (iPhone, Android, ...). Likewise, WL.SimpleDialog did not work - until the "org.apache.cordova.dialogs" plug-in was added to the project. I had tried adding all of the Cordova plugins but no luck

How to get WL.App.OpenURL work in BlackBerry 10?

Idan Adar
  • 44,156
  • 13
  • 50
  • 89
Rohit Rathod
  • 118
  • 7

2 Answers2

1

I am not sure why WL.App.openURL fails for you, but this method is basically like window.open, so what you can do is use window.open per the Cordova documentation, here: https://github.com/apache/cordova-plugin-inappbrowser/blob/master/doc/index.md

We'll look into whether the API method works or not...

Idan Adar
  • 44,156
  • 13
  • 50
  • 89
  • Hi Idan, I want do not want to open url inside inAppBrowser having close button on top, I have tired window.open but its not what i am seeking. Same WL.App.OpenURL is opening link in android default browser. please suggest something. – Rohit Rathod Oct 10 '14 at 13:36
  • @rohit, you are not clear; maybe you should explain what you do want. – Idan Adar Oct 10 '14 at 13:36
  • I want to open a website URL in BB10 default browser. WL.App.openURL is not working for me on BB10 devices. I have added plugins to my Webworks project at path "MyProject\plugins" also there are default worklight plugins at path "www\webresources\default\worklight\plugins". – Rohit Rathod Oct 13 '14 at 06:00
  • So did you try `window.open("http://www.google.com/", "_system")`, instead? _system means it will use the default browser as opposed to _blank, which should supposedly open the URL in an InAppBrowser. – Idan Adar Oct 13 '14 at 06:01
  • You can also try BB's own API for this, see the second option here: http://stackoverflow.com/questions/22833137/open-link-in-external-browser-from-blackberry10-with-cordova – Idan Adar Oct 13 '14 at 06:03
  • Hi Idan, window.open("http://www.google.com/", "_system") did solved my problem..:) but i am still thinking why? WL.App.openURL is not getting invoked in BB10 even after adding all cordova plugins to my webworks project. If you find something on this please do let me know.:) Thanks a Ton!!!! – Rohit Rathod Oct 13 '14 at 14:53
  • Using window.open is perfectly valid. We'll look into WL.App.openURL not working. If your question is now resolved, please accept this answer. – Idan Adar Oct 13 '14 at 15:09
  • Hi Idan, Did you found why WL.App.openURL is not working in BB10. Please do revert me on the same. – Rohit Rathod Nov 04 '14 at 07:42
  • Not yet; feel free to open a PMR if you need official IBM support. – Idan Adar Nov 04 '14 at 08:00
1

WL.App.OpenURL() needs "invoke" plugin to be present in the config.xml.

Verify the config.xml and check if the feature is present. If not, add the plugin using the command -

        webworks plugin add com.blackberry.invoke

https://developer.blackberry.com/html5/apis/v2_2/blackberry.invoke.html

Vivin K
  • 2,681
  • 1
  • 11
  • 14
  • I had tried adding invoke plugin but still its not working. Also i want use e-mail plugin in my BB10 application, i have already tried my hands on invoke.card plugin but it is not getting triggered i have added feature as follow :- – Rohit Rathod Oct 10 '14 at 13:21
  • Hi Rohit, Can you please provide the WebWorks SDK details that you used, to build your project. – Vivin K Oct 13 '14 at 06:01
  • BlackBerry WebWorks 2.1.0.13 – Rohit Rathod Oct 13 '14 at 15:02
  • Rohit, Can you try the steps mentioned in the blog below : https://www.ibm.com/developerworks/community/blogs/worklight/entry/worklight_blackberry10_project_with_webworks_sdk_2_0?lang=en Specifically the section "Upgrade Worklight BB10 Project" onwards. This will help you run a BB10 project generated in Worklight studio on WebWorks SDK 2.x – Vivin K Oct 14 '14 at 05:58
  • Vivin, I am doing the same step as given in the link which you have provided but still not able to get WL.App.openURL triggered. Thanks for your Reply :) – Rohit Rathod Oct 15 '14 at 05:43
  • Hi Vivin, I have also tried adding 'blackberry.app' and 'blackberry.invoke' plugin in my project but its of no help its giving "blackberry.app" undefined. I would appreciate your help on this. :) – Rohit Rathod Nov 04 '14 at 07:45