How to link to Facebook and Twitter in Cascades

In cascades it is possible to link directly to a particular Facebook or Twitter profile using the following code.


void MyApp::invokeTwitter()
{
bb::system::InvokeManager* m_invokeManager;
m_invokeManager = new InvokeManager(this);
InvokeRequest request;
request.setTarget("com.twitter.urihandler");
request.setAction("bb.action.VIEW");
request.setUri("twitter:connect:ebscer");
m_invokeManager->invoke(request);
}

void MyApp::invokeFacebook()
{
bb::system::InvokeManager* m_invokeManager;
m_invokeManager = new InvokeManager(this);
InvokeRequest request;
request.setTarget("com.rim.bb.app.facebook");
request.setAction("bb.action.OPEN");
QVariantMap payload;
payload["object_type"] = "page";
payload["object_id"] = "152370494833193";
request.setMetadata(payload);
m_invokeManager->invoke(request);
}

Calling this code will directly open the Twitter and Facebook pages for Ebscer.