Since recently there is documentation on BlackBerry how to do that.
Extend 'bar-descriptor.xml' file with desired urischeme:
<invoke-target id="com.mycompany.myapplication">
<type>APPLICATION</type>
<filter>
<action>bb.action.VIEW</action>
<mime-type>*</mime-type>
<property var="uris" value="activetext:"/>
</filter>
<invoke-target-pattern>
<pattern-value type="uri">activetext:</pattern-value>
</invoke-target-pattern>
After that in application code (from BlackBerry documentation):
// File: service.cpp
#include "service.hpp"
#include <bb/Application>
#include <bb/platform/Notification>
#include <bb/platform/NotificationDefaultApplicationSettings>
#include <bb/system/InvokeManager>
using namespace bb::platform;
using namespace bb::system;
Service::Service() :
QObject(),
m_notify(new Notification(this)),
m_invokeManager(new InvokeManager(this))
{
// Whenever the app is invoked, call handleInvoke()
m_invokeManager->connect(m_invokeManager,
SIGNAL(invoked(const bb::system::InvokeRequest&)),
this,
SLOT(handleInvoke(const bb::system::InvokeRequest&)));
// Configure app to allow notifications
NotificationDefaultApplicationSettings settings;
settings.setPreview(NotificationPriorityPolicy::Allow);
settings.apply();
// Set a common notification title
m_notify->setTitle("Headless service");
}
void Service::handleInvoke(
const bb::system::InvokeRequest & request)
{
// Check if timer trigger invoked the app
if (request.action().compare("bb.action.VIEW")
== 0) {
m_notify->setBody("Timer alert!");
Notification::clearEffectsForAll();
Notification::deleteAllFromInbox();
m_notify->notify();
// Do necessary handling here.
qDebug() << request.uri();
}
}
BlackBerry Documentation