Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development


Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.


Reply
Highlighted
Developer
Posts: 85
Registered: ‎06-22-2013
My Device: N/A
My Carrier: N/A
Accepted Solution

Share text at FaceBook Or Tweeter

Hi,

 

How can i share some text  at FaceBook or Tweeter.

 

Thanks,

Developer
Posts: 123
Registered: ‎09-18-2013
My Device: Dev Alpha B
My Carrier: BSNL INDIA

Re: Share text at FaceBook Or Tweeter

[ Edited ]

You can use invokation framework to accomplish this, use the following to invoke Facebook app to share text

 

 

https://developer.blackberry.com/native/documentation/cascades/device_platform/invocation/facebook.h...

 

 

Target ID

Facebook

Action

bb.action.SHARE

MIME type text/plain
URI data://
Data Text string to be shared

 

 

twitter:

https://developer.blackberry.com/native/documentation/cascades/device_platform/invocation/twitter.ht...

 

Target ID

Twitter

Action

bb.action.SHARE

MIME type

text/plain

URI

data://

Data

Text string to be shared

 

Please note that all the invocation attributes related to the Twitter/FB app require a Twitter/FB account respectively to be set up on the device. Hope it's clear. Do ask if u need a detailed description on how to do this.

 

[     PLEASE READ : as :   ]

Developer
Posts: 85
Registered: ‎06-22-2013
My Device: N/A
My Carrier: N/A

Re: Share text at FaceBook Or Tweeter

Thanks for the quick reply,

 

i'm using this function, what is wrong with it. 

 

void faceBookShare() 
{
	InvokeRequest request;
	request.setTarget("Facebook");
	request.setAction("bb.action.SHARE");
	request.setMimeType("text/plain");
	request.setUri("http://google.com/");
	m_invokeManager->invoke(request);

}

 

Developer
Posts: 123
Registered: ‎09-18-2013
My Device: Dev Alpha B
My Carrier: BSNL INDIA

Re: Share text at FaceBook Or Tweeter

[ Edited ]
InvokeTargetReply *invokeReply; //AS A GLOBAL VARIABLE

invokeReply = m_invokeManager->invoke(request);

if(invokeReply)
{
invokeReply->setParent(this);
connect(invokeReply, SIGNAL(finished()), this, SLOT(invokeFinished()));
}

 and define the invokeFinished() slot as:

 

void invokeFinished()
{
	switch (invokeReply->error())
	{
	case InvokeReplyError::NoTarget:
		qDebug()<<"Target not found";
		break;
	case InvokeReplyError::BadRequest:
		qDebug()<<"Bad request";
		break;
	case InvokeReplyError::Internal:
		qDebug()<<"Internal error";
		break;
	default:
		qDebug()<<"No errors found, carried out successfully";
		break;
	}

 

tell me what results you get.

 

 

 

BUT DO THIS FIRST.. THIS MIGHT BE THE ERROR..

 

The Uri should be data&colon;//

The data should be what you want to share, encoded into a QByteArray.

 

request.setUri("data&colon;//");
request.setData("Some string, QStrings will work without any typecast");

//PLEASE READ &colon; as :