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: 12
Registered: ‎07-06-2013
My Device: Q10
My Carrier: Indosat

How to share plain text unbound invocation?

[ Edited ]

I used the code below in order to create a plain text unbound invocation:

 

navigator_invoke_invocation_t *invoke = 0;
navigator_invoke_invocation_create(&invoke);
navigator_invoke_invocation_set_action(invoke, "bb.action.SHARE");
navigator_invoke_invocation_set_type(invoke, "text/plain");
navigator_invoke_invocation_set_uri(invoke, "data://");
navigator_invoke_invocation_set_data(invoke, message, strlen(message));
navigator_invoke_invocation_send(invoke);
navigator_invoke_invocation_destroy(invoke);

 

But then it gets my BFB review rejected with the following reason:

 

"• When I finished a levelof your game and press the 'Share' button and select BBM, the application only share "data://" to a BBM group. Please make sure that the content your app share is relevant with the application"

 


Basically, when the code above gets triggered, the app will invoke BBM Group and send the uri ("data://"), not the message/data, which is not as I expected.

 

So, how to do it correctly?

Developer
Posts: 1,524
Registered: ‎12-18-2012
My Device: Z30, Z10 LE, DevAlpha C, PlayBook

Re: How to share plain text unbound invocation?

Did you try commenting out
navigator_invoke_invocation_set_uri(invoke, "data://");
?
I don't think it's needed if you're setting the data.

Andrey Fidrya, @zmeyc on twitter
Contributor
Posts: 12
Registered: ‎07-06-2013
My Device: Q10
My Carrier: Indosat

Re: How to share plain text unbound invocation?

Hello,

Yes, I tried commenting out that line and it now sends the correct message, but the code will *always* invoke BBM Groups while I want an *unbound* invocation. I want the user to choose which app will handle the invocation.

How to do that?

Thank you.
Highlighted
BlackBerry Development Advisor
Posts: 15,812
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
My Carrier: Bell

Re: How to share plain text unbound invocation?


djzmo wrote:
Hello,

Yes, I tried commenting out that line and it now sends the correct message, but the code will *always* invoke BBM Groups while I want an *unbound* invocation. I want the user to choose which app will handle the invocation.

How to do that?

Thank you.

That is only available when using the Cascades C++ or QML APIs.  The invocation target selector is not available when using the C APIs.  You could query for invocation targets and present a list to the user if you need to use the C APIs.

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.