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
New Developer
Posts: 7
Registered: ‎07-24-2012
My Device: Dev Alpha C, Z10LE, Playbook
My Carrier: Optus
Accepted Solution

Opening an existing email in with the native viewer

I've seen a few examples whereby the native email viewer can be opened to in various stages of email composition, but I'm trying to open up an enxisting email...

 

According to the last entry on this page: 

 

https://developer.blackberry.com/cascades/documentation/device_platform/invocation/email.html

 

That's seem possible assuming a URL format of:

 

pim:message/rfc822:[accountID]:[messageID]

 

So I've tried to do just that a few ways, but I always end up with a blank email ready for composition (not what I want).

 

I'm not sure if the uri of the message has to be entered into the request "as data", or just by calling setUri on the request object. For example:

 

request.setTarget("sys.pim.uib.email.hybridcomposer");

request.setAction("bb.action.VIEW");

request.setMimeType("message/rfc822");

 

QVariant accID = QVariant::fromValue(m_currentAccount.id());

QVariant mID  =  QVariant::fromValue(m_currentMessageId);

 

QUrl url = QUrl("pim:message/rfc822:" + accID.toString() + ":" + mID.toString() + "");

QByteArray data;

data.append("[ { \"uri\": [\"");

data.append(url.toString(QUrl::None));

data.append("\"] } ]");

InvokeTargetReply *reply = invokeManager.invoke(request);

 

woud result in data containing "[ { "uri": ["pim:message/rfc822:1366609299:773"] } ]"

 

but alas no email, same if replace the last bit with:

 

QUrl url = QUrl("pim:message/rfc822:" + accID.toString() + ":" + mID.toString() + "");

request.setUri(url);

 

e.g. url looks like: "pim:message/rfc822:1366609299:1206"

 

 

still end up with a blank, ready to compose, email? Any clues as to what I'm missing?

 

Kind Regards

Kev

 

 

New Developer
Posts: 7
Registered: ‎07-24-2012
My Device: Dev Alpha C, Z10LE, Playbook
My Carrier: Optus

Re: Opening an existing email in with the native viewer

Looks like the documentation is wronge. If you want to display an exising email the target needs to be set to

"sys.pim.uib.email.previewer".

 

Had to use the queryTarget mechanism to figuret this out.