2

Are there any examples of invoking the BlackBerry 10 browser to open on an onclick event? I'm trying to do this with the native SDK using c++.

Thanks

Michael Donohue
  • 11,776
  • 5
  • 31
  • 44
Mikerizzo
  • 587
  • 1
  • 4
  • 22

2 Answers2

5

HTML5

Taken from the sample here:

function openWebLink() {
    // open web link - allows the system to choose an appropriate target that handles http://
    blackberry.invoke.invoke({
        uri: "http://www.blackberry.com"
    }, onInvokeSuccess, onInvokeError);
}

function openWebLinkInBrowser() {
    // open web link in browser
    blackberry.invoke.invoke({
        target: "sys.browser",
        uri: "http://www.blackberry.com"
    }, onInvokeSuccess, onInvokeError);
}

Native

Using the following attributes...

Cascades

An example is available here

Pure

Use navigator_invoke.h

navigator_invoke_invocation_t *invoke = NULL;
navigator_invoke_invocation_create(&invoke);

navigator_invoke_invocation_set_target(invoke, "sys.browser");
navigator_invoke_invocation_set_action(invoke, "bb.action.OPEN");
navigator_invoke_invocation_set_uri(invoke, "http://stackoverflow.com");

navigator_invoke_invocation_send(invoke);
navigator_invoke_invocation_destroy(invoke);
Doug Moscrop
  • 4,479
  • 3
  • 26
  • 46
2

Include Qt library and call

Qt.openUrlExternally(targetUri);
kleopatra
  • 51,061
  • 28
  • 99
  • 211
Manoj K
  • 326
  • 1
  • 6