Is it possible to register an application to be launched when a specific URL is requested in the browser, email or bbm?
For example I would like when the user clicks on a link flycraft://replay/123 my app to be launched and passed the URI.
Is it possible to register an application to be launched when a specific URL is requested in the browser, email or bbm?
For example I would like when the user clicks on a link flycraft://replay/123 my app to be launched and passed the URI.
This is not possible at the moment.
There are 2 parts to this:
flycraft://
so that the browser knows to treat these links as invocable.flycraft://
invocation so that your apps loads. Unfortunately the first part is not possible at present. There are plans but nothing concrete at this stage.
Yes! You can do this using the BB10 invocation framework. A fair amount of detail is provided at appurl.org. In short:
<property var="uris" value="flycraft:"> </property>
invokeManager
object to your app's main
, and connect its invoked
signal to some slot of your code that can handle that request.The way to do this on BlackBerry 10 is by adding the code below in your bar descriptor file:
<invoke-target id="eu.nlogn.flycraftplaybook.replayview">
<invoke-target-type>application</invoke-target-type>
<filter>
<action>bb.action.VIEW</action>
<mime-type>*</mime-type>
<property value="flycraft://" var="uris" />
</filter>
</invoke-target>
then you should listen for the NAVIGATOR_INVOKE_TARGET event and handle it like this:
const navigator_invoke_invocation_t *invoke = navigator_invoke_event_get_invocation(event);
if (invoke) {
// retrieve invocation action
const char *action = navigator_invoke_invocation_get_action(invoke);
const char *uri = navigator_invoke_invocation_get_uri(invoke);
if (action && uri) {
// handle the uri you got
}
} else {
fprintf(stderr, "Error retrieving invocation: %s\n", navigator_event_get_err(event));
}
Unfortunately there is no way to do this on the Playbook.