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
Posts: 11
Registered: ‎04-09-2013
My Device: None
My Carrier: None
Accepted Solution

Opening email client from application

[ Edited ]

I have been trying to get this to work for a little over a day now. I am trying to use the "navigator_invoke" from bps to make a mailto call like so:

 

char* result = 0;
std::stringstream st;
st << "mailto::test@test.com";
int error = navigator_invoke(st.str().c_str(), &result);

 

When I run this on the Z10 or Devalpha it returns an error with result="notfound". If I run the same code on the Playbook it works fine. Can anyone give me an idea on where to find a solution?

 

I am working in c++ and do not use Cascades or WebWorks.

Retired
Posts: 418
Registered: ‎07-18-2012
My Device: Q10
My Carrier: Bell Canada

Re: Opening email client from application

Can you test it again with only one ":"

eg:

mailto:fred@fred.com

 

On some dev alpha's (without Hub) i'd expect it to fail...

 

 

 

 

 

 

--
Rob is no longer associated with BlackBerry.
Contributor
Posts: 11
Registered: ‎04-09-2013
My Device: None
My Carrier: None

Re: Opening email client from application

Over the past day I have tried:

 

"mailto:test@test.com"
"messages::test@test.com"

"messages:test@test.com"

 

All on both the Z10 and the devalpha. None have worked.

 

Retired
Posts: 418
Registered: ‎07-18-2012
My Device: Q10
My Carrier: Bell Canada

Re: Opening email client from application

I suspect the documentation is out of date; try using the invocation frame work like this;

 

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

--
Rob is no longer associated with BlackBerry.
Contributor
Posts: 11
Registered: ‎04-09-2013
My Device: None
My Carrier: None

Re: Opening email client from application

I am not using Cascades, but just the native and bps libraries.

Retired
Posts: 418
Registered: ‎07-18-2012
My Device: Q10
My Carrier: Bell Canada

Re: Opening email client from application

Hi, 

 

The targets from that previous link will apply to using the C api too;

 

https://developer.blackberry.com/native/reference/bb10/com.qnx.doc.bps.lib_ref/com.qnx.doc.bps.lib_r...

--
Rob is no longer associated with BlackBerry.
Contributor
Posts: 11
Registered: ‎04-09-2013
My Device: None
My Carrier: None

Re: Opening email client from application

I have tried what was on the page, as best as I could, but no difference.

 

 I have also tried opening other things with the navigator_invoke.

 

works:

"maps:/"

"appworld:/"
"http://www.google.ca"
"camera://photo"
"calendar://"
"settings://about"

Not working
"mailto:/"
"messages:/"
"music://albums"
"photos://"
"videos://recorded"
"musicstore://search=test"
"vchat://"

Contributor
Posts: 11
Registered: ‎04-09-2013
My Device: None
My Carrier: None

Re: Opening email client from application

I should also mention, I have also opened the browser and manually types in "mailto://" in the address bar, and that does open the email composer.

 

Not sure if that helps.

Retired
Posts: 418
Registered: ‎07-18-2012
My Device: Q10
My Carrier: Bell Canada

Re: Opening email client from application

Here's code that works for me; (this is bad code... no return value checking...)

 

	navigator_invoke_invocation_t * invocation = NULL;
	navigator_invoke_invocation_create(&invocation);
	navigator_invoke_invocation_set_uri(invocation, "mailto:freddy@blackberry.com");
	navigator_invoke_invocation_send(invocation);
 	navigator_invoke_invocation_destroy(invocation);

 Is this similar to what you tried?

--
Rob is no longer associated with BlackBerry.
Contributor
Posts: 11
Registered: ‎04-09-2013
My Device: None
My Carrier: None

Re: Opening email client from application

No, but when I tried I could not #include <bps/navigator_invoke.h>. It says "No such file or directory". I suspect that is something outside the Native only scope I am using so far.