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

Web and WebWorks 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.

New Developer
Posts: 31
Registered: ‎04-21-2011
My Device: Playbook
My Carrier: N/A
Accepted Solution

Invoke Facebook with base64 image + text



I'm trying to share an image (from the screenshot extension) to Facebook without writing it to disk. I would also like to be able to include text and a photo in the invoke call. Unfortunately, while I have a valid base64 image (renders properly with 'window.open', and I can invoke facebook with text only, I am unable to invoke with the base64 image. Any pointers would be greatly appreciated!


function ss() {
	var options = {dest:'data:', mime:'image/png'};
	var screenshot = community.screenshot.execute(options);
	// check result
	if(screenshot.substr(0,5)=="data:") {

		// Pixastic assumes the image is in an img tag
		var oImg=document.createElement("img");
		oImg.setAttribute('src', screenshot);
		// crop the image
		Pixastic.process(oImg, "crop", { rect : { left : 0, top : 0, width : 100, height : 100 } }, function (oCanvas){ 
			// this works perfectly, so the image is good:
			// window.open(oCanvas.toDataURL()); 

				// this works, so invoke permissions must be right:
			        target: "Facebook",
			        action: "bb.action.SHARE",
			        type: "text/plain",
			        data: "some text"
			    }, function() {console.log("FB SUCCESS!");}, function() {console.log("FB ERROR!");});
				// no amount of munging with this will work (e.g., using 'data' instead of uri):
			        target: "Facebook",
			        action: "bb.action.SHARE",
			        type: "image/png",
			        uri: oCanvas.toDataURL()
			    }, function() {console.log("FB SUCCESS!");}, function() {console.log("FB ERROR!");});




Posts: 856
Registered: ‎07-15-2008
My Device: Passport
My Carrier: Bell

Re: Invoke Facebook with base64 image + text

I am told that Facebook filters only look at files.


If you write to the /tmp directory, it is backed by RAM, so that should alleviate most performance concerns.

Tim Windsor
Open Source Technical Lead