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

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

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.