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 Contributor
JKon5
Posts: 2
Registered: ‎04-11-2013
My Device: Dev Alpha A
My Carrier: Tele2
Accepted Solution

navigator_invoke and Dev Alpha

[ Edited ]

Hey,
so I'm working with Dev Alpha A and trying to do some simple stuff like compose email or tweet a message, by using navigator_invoke, however it seems that Twitter and FB is not available on Dev Alpha? also mailto: and messages:// doesnt seem to work (error message is "notfound"), is this because of Dev Alpha A and only with Z10 this stuff will work or am i missing something? 

Device is updated, latest sdk, everything is up to date.
Browser and BB world is working with navigator_invoke
sample of what i was trying to do:

 

navigator_invoke("mailto:me@me.com?subject=Message&body=Blabla", &err);


and

navigator_invoke("messages://", &err);
it should open messages, right? but i just get notfound

Thank you.

EDIT:
i found some similar topics (somehow missed them before - sorry), it could be that documentation is out of date, i will try to use this:
https://developer.blackberry.com/native/reference/bb10/com.qnx.doc.bps.lib_ref/com.qnx.doc.bps.lib_r...

Please use plain text.
Developer
kanaksony
Posts: 571
Registered: ‎04-11-2009
My Device: BB 10 Dev Alpha

Re: navigator_invoke and Dev Alpha

Hi,

 

This is working in Dev Alpha A.

 

void EmailDemo::composeEmailAndInvoke() {
	bb::system::InvokeManager* m_invokeManager = new bb::system::InvokeManager(this);
	bb::system::InvokeRequest request;

	request.setTarget(QString("sys.pim.uib.email.hybridcomposer"));
	request.setAction(QString("bb.action.SENDEMAIL"));
	request.setMimeType(QString("message/rfc822"));
	request.setUri("mailto:ksony@me.com?cc=ksony@me.com&subject=A%20Subject&body=That%20body");
	m_invokeManager->invoke(request);
}

 

Regards,
Kanak Sony
------------------------------------------------------------------------------------------
http://dodevelopnshare.wordpress.com/ | http://www.linkedin.com/profile/view?id=188131481&trk=tab_pro
Please use plain text.
New Contributor
JKon5
Posts: 2
Registered: ‎04-11-2013
My Device: Dev Alpha A
My Carrier: Tele2

Re: navigator_invoke and Dev Alpha

[ Edited ]

kanaksony wrote:

Hi,

 

This is working in Dev Alpha A.

 

void EmailDemo::composeEmailAndInvoke() {
	bb::system::InvokeManager* m_invokeManager = new bb::system::InvokeManager(this);
	bb::system::InvokeRequest request;

	request.setTarget(QString("sys.pim.uib.email.hybridcomposer"));
	request.setAction(QString("bb.action.SENDEMAIL"));
	request.setMimeType(QString("message/rfc822"));
	request.setUri("mailto:ksony@me.com?cc=ksony@me.com&subject=A%20Subject&body=That%20body");
	m_invokeManager->invoke(request);
}

 




Thanks, but i'm not using Cascades, however i tried equivalent of this in Native:

navigator_invoke_invocation_t *iRequest = NULL;
	navigator_invoke_invocation_create(&iRequest);
	navigator_invoke_invocation_set_action(iRequest, "bb.action.SENDEMAIL");
	navigator_invoke_invocation_set_target(iRequest,"sys.pim.uib.email.hybridcomposer");
	navigator_invoke_invocation_set_type(iRequest,"message/rfc822");
	std::string URI = "mailto:me@me.com?cc=me@me.com&subject=A%20Subject&body=That%20body";
	navigator_invoke_invocation_set_uri(iRequest,URI.c_str());
	navigator_invoke_invocation_send(iRequest);

 

 

now composer opens, but fields are empty, but at least something happened!
but what about FB and Twitter?

EDIT: fixed code, now fields are filled properly!

Please use plain text.