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
Developer
biggerCC
Posts: 270
Registered: ‎12-13-2010
My Device: PlayBook 16GB, BB10 Dev Alpha
My Carrier: o2 (de)

Sending emails with navigator_invoke()

Hi there,

 

I'm using navigator_invoke() for a couple of things (e.g. opening the browser "http://" or calling numbers "tel:"), because using the Cascades invocation framework is not an option for me. The invocation framework only works if the app is currenty running in the foreground and therefore not applicable for my project where the UI is not required at all (all actions are triggered by incoming push messages).

 

So, here's my problem: I cannot use the "mailto:" scheme, altough it is supposed to work according to the documentation.

 

Triggering for example:

mailto:webmaster@heise.de

Returns the following error:

notfound

 

Any ideas?

- - -
My approved apps @ App World
Please use plain text.
Developer
biggerCC
Posts: 270
Registered: ‎12-13-2010
My Device: PlayBook 16GB, BB10 Dev Alpha
My Carrier: o2 (de)

Re: Sending emails with navigator_invoke()

No ideas? Anybody?

- - -
My approved apps @ App World
Please use plain text.
BlackBerry Development Advisor
shaque
Posts: 231
Registered: ‎07-14-2008
My Device: Not Specified

Re: Sending emails with navigator_invoke()

[ Edited ]

Hi,
It is currently not permitted to invoke while in the background. Is this the issue or are you having issues with invoking while in the foreground as well?

Shadid

Please use plain text.
Developer
biggerCC
Posts: 270
Registered: ‎12-13-2010
My Device: PlayBook 16GB, BB10 Dev Alpha
My Carrier: o2 (de)

Re: Sending emails with navigator_invoke()

I was already told (although I couldn't find it in the official docs) that invocation only works if the app is currently in the foreground - which would kill my (almost finished) app idea...

But luckily navigator_invoke() seems to ignore that limitation and therefore I make use of it.

 

My question is, why does navigator_invoke() not work with email addresses as the documentation states? The code sample I have pasted here does not work, independently of my app running in the foreground or not. Calling it with any http:// URL does open the browser.

- - -
My approved apps @ App World
Please use plain text.
BlackBerry Development Advisor
shaque
Posts: 231
Registered: ‎07-14-2008
My Device: Not Specified

Re: Sending emails with navigator_invoke()

navigator_invoke() should not be used for invoking apps in BB10. This is an API from the PlayBook OS days. While some of the old invokes are still supported there but some may not work. Apologies but the docs should be updated.
Please use plain text.
Developer
biggerCC
Posts: 270
Registered: ‎12-13-2010
My Device: PlayBook 16GB, BB10 Dev Alpha
My Carrier: o2 (de)

Re: Sending emails with navigator_invoke()

This is sad, but seemingly there's nothing developers can do about it...

 

So I modified my codebase in order to invoke my actions via Hub notifications - which also works for invoking my own app, the phone and the browser.

However, it behaves weird when trying to invoke the email hybridcomposer - again!

 

It works when called directly from my (foreground running) app:

InvokeManager invokeManager;
InvokeRequest invokeRequest;

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

invokeManager.invoke(invokeRequest);

 

It does not work when invoked via the HUB (although I couldn't find out how to debug it to get further details):

Notification *notification = new Notification(NOTIFICATION_PREFIX + QString::number(push.seqNum()),this);
InvokeRequest invokeRequest;

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

notification->setTitle("Just Testing...");
notification->setInvokeRequest(invokeRequest);
notification->notify();

 

So: Who messed up the invocation framework? :smileyvery-happy:

 

No, but seriously: what can I do about it?

- - -
My approved apps @ App World
Please use plain text.