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
Developer
Posts: 889
Registered: ‎08-31-2009
My Device: 9530, 9630, 9800, 8530, 9900, 9810, 9930, PlayBook, Dev Alpha
My Carrier: Verizon
Accepted Solution

Use invocation to share a file

Has anyone figured out how to share a file via invocation in cascades? If I do an unbound invocation I get the screen offering multiple invocation targets, but after selecting one, the invocation just closes without sharing anything. It is possible that I am formatting the uri incorrectly, but any working sample that anyone has would be appreciated.


Read my thoughts on BlackBerry Development at news.ebscer.com
Developer
Posts: 64
Registered: ‎09-10-2009
My Device: Z10, Bold 9700
My Carrier: O2 Germany

Re: Use invocation to share a file

Do you have the latest OS update for the Dev Alpha installed? I'm also using an unbound invocation for sharing and I just successfully tested sharing a PDF file from our app via email.

The file is stored in the home directory (data) of the local sandbox. I'm setting its "file:///..." uri and the MIME type on the InvokeActionItem. Do you have the correct MIME type set, e.g. application/pdf for a PDF file?
----

My Twitter: @hendrik_dev
Developer
Posts: 889
Registered: ‎08-31-2009
My Device: 9530, 9630, 9800, 8530, 9900, 9810, 9930, PlayBook, Dev Alpha
My Carrier: Verizon

Re: Use invocation to share a file

I have my MIME type set to 'text/html' the file I am trying to share is in the shared directory (which I can access if I manually attach a file to a new email). I set the uri in the format

uri: "file:///shared/misc/fileName.html"

 is this correct?


Read my thoughts on BlackBerry Development at news.ebscer.com
Developer
Posts: 64
Registered: ‎09-10-2009
My Device: Z10, Bold 9700
My Carrier: O2 Germany

Re: Use invocation to share a file

The MIME type is correct. But there is an error in your uri. You have to construct your uri this way:

"file://" + workingDir + "/shared/misc/fileName.html"

 You have to use C++ code to get the working directory:

QString workingDir = QDir::currentPath();

 

Have a look at this article for more details:

https://developer.blackberry.com/cascades/documentation/device_platform/filesystem/index.html

 

----

My Twitter: @hendrik_dev
Highlighted
Developer
Posts: 889
Registered: ‎08-31-2009
My Device: 9530, 9630, 9800, 8530, 9900, 9810, 9930, PlayBook, Dev Alpha
My Carrier: Verizon

Re: Use invocation to share a file

Thanks. That was the issue.

 

Now I just need to figure out how to dynamically set the uri...


Read my thoughts on BlackBerry Development at news.ebscer.com