0

Following the BlackBerry documentation on the Invocation Framework, I'm trying to invoke opening a contact, and SMS and E-mail composing. The contact opening works fine, but I cannot get the SMS and E-mail composition to work in the Simulator. The code is being executed, but nothing happens. Any ideas what can I be doing wrong?

Here's a piece of the code I'm using:

InvokeRequest request;
request.setAction("bb.action.COMPOSE");
request.setMimeType("message/rfc822");
request.setTarget("sys.pim.uib.email.hybridcomposer");

QByteArray ba(list.toUtf8());
request.setData(ba);
m_invokeManager->invoke(request);

Thanks for any hints!

Eir
  • 1,003
  • 9
  • 24

1 Answers1

2

I am also facing this issue.

SMS and E-mail is not working simulator because SMS/Email app is not installed in simulator.

You have to test in device.

Below code is working fine in device for me..

Send SMS:

InvokeRequest invokeRequest;
invokeRequest.setTarget("sys.pim.text_messaging.smsuri");
invokeRequest.setAction("bb.action.OPEN");
invokeRequest.setUri("sms:4444");
invokeRequest.setMimeType("*");

Send Email:

InvokeRequest invokeRequest;
invokeRequest.setTarget("sys.pim.uib.email.hybridcomposer");
invokeRequest.setAction("bb.action.COMPOSE");
invokeRequest.setUri("mailto:info@google.com");
invokeRequest.setMimeType("message/rfc822")

Thanks..

Niranj Patel
  • 32,980
  • 10
  • 97
  • 133
  • Thanks for the fast answer! But the E-mail app is installed on the simulator, I can initiate E-mail composition from BlackBerry's Contacts app, but not from my app. – Eir Apr 06 '13 at 10:04
  • Thanks a lot! Just to make things clear: Sending E-mail works on the Simulator, but only using the URI, not with the JSON data, as described in the documentation here: https://developer.blackberry.com/cascades/documentation/device_platform/invocation/email.html – Eir Apr 06 '13 at 13:19
  • Btw, how do you send an SMS to more than one number using the URI? – Eir Apr 06 '13 at 13:21
  • 1
    try this one **"sms:4444,5555"** for send more than one number... May be this will work.. – Niranj Patel Apr 08 '13 at 04:06