03-18-2013 01:23 AM
When I select Open from the Hub it launches my app but how do I connect the notification/request to my app so that it knows it has been called?
Is there a signal to connect the Notification or request?
03-18-2013 07:48 AM
smiley wrote:
When I select Open from the Hub it launches my app but how do I connect the notification/request to my app so that it knows it has been called?
Is there a signal to connect the Notification or request?
this is easy done
// we can be invoked as an app from notification in HUB
bool ok = connect(mInvokeManager,
SIGNAL(invoked(const bb::system::InvokeRequest&)), this,
SLOT(handleInvoke(const bb::system::InvokeRequest&)));
if (!ok) {
qDebug() << "connect handleInvoke failed";
}
and then handle this
void EkkesTeaTimer::handleInvoke(const InvokeRequest& request) {
// do your stuff here, you have access to the request:
qDebug() << "Invoke Request";
qDebug() << "Invoke Request Action:" << request.action();
qDebug() << "Invoke Request Mime:" << request.mimeType();
qDebug() << "Invoke Request URI:" << request.uri();
qDebug() << "Invoke Request Data:" << request.data();
}
03-18-2013 10:24 AM - edited 03-18-2013 11:29 AM
thanks but how do I use mInvokeManager?
update: Figured it out. I had to create an instance of the InvokeManager.
thanks
03-18-2013 12:05 PM
smiley wrote:
thanks but how do I use mInvokeManager?
update: Figured it out. I had to create an instance of the InvokeManager.
thanks
yep
I'm declaring it in .hpp
bb::system::InvokeManager *mInvokeManager;
and in .cpp constructor I initialize
EkkesTeaTimer::EkkesTeaTimer(bb::cascades::Application *app) : QObject(app), mInvokeManager(new InvokeManager(this))
if you're doing some stuff with InvocationFramework you should only use one instance of InvokeManager