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
Contributor
tyler_tu
Posts: 26
Registered: ‎06-17-2013
My Device: Z10

Email invoke sometimes not working.

Hello,

 

I have a function to invoke the email from my app.  It works most of time, but sometimes it didn't bring up the email app. And once it stops working, i will not go back to normal unless close and reopen my app.

 

I didn't see any suspecious device log when this issue happened.  Here is my code and thanks for any advice in advance.

 

void Util::invokeEmail(QString to, QString subject, QString body, QVariantList attachment_list){

bb::system::InvokeRequest request;

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

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

request.setMimeType("message/rfc822");

 

QVariantMap data;

 

QVariantList to_list;

if (!to.isEmpty())

to_list.push_back(to);

 

data["to"] = to_list;

data["subject"] = subject;

data["body"] = body;

if (!attachment_list.isEmpty())

data["attachment"] = attachment_list;

 

QVariantMap root;

root["data"] = data;

 

bool ok;

request.setData(bb::PpsObject::encode(root, &ok));

 

bb::system::InvokeManager *invokeManager = new bb::system::InvokeManager();

invokeManager->invoke(request);

Log::debug(TAG, QString("invokeEmail"));

    QObject::connect(invokeManager, SIGNAL(childCardDone(const bb::system::CardDoneMessage &)), invokeManager, SLOT(deleteLater()));

}

 

BlackBerry Development Advisor
sabdelsayed
Posts: 249
Registered: ‎08-17-2012
My Device: BlackBerry Z10 and Q10

Re: Email invoke sometimes not working.

Hi tyler_tu,

 

What SDK and OS versions are you using? I tried your code below on the 10.2 SDK and it works as expected.

@SamarAbdelsayed

Did this answer your question? Please accept post as solution.
Please refrain from posting new questions in solved threads.
Found a bug? Report it using the Issue Tracker
Contributor
tyler_tu
Posts: 26
Registered: ‎06-17-2013
My Device: Z10

Re: Email invoke sometimes not working.

Thanks SamarAbdelsayed for the reply.

 

I tested it on both 10.1 and 10.2.  Yes, it normally works as expected.  But randomly it stops working and cannot back to normal anymore so I reported this and see if any other developers hit the same issue.