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

Adobe AIR Development


Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.


Reply
Developer
Posts: 250
Registered: ‎03-14-2012
My Device: PlayBook 2.0
My Carrier: AT&T

BB10 invocation framework - Empty event

Hi,

 

I'm using the code below to handle shared text from other apps but the received invoke event is empty.

What could cause that problem?

 

package
{
import qnx.events.InvokeEvent;
import qnx.invoke.*;

public class Main extends Sprite
{

public function Main()
{
//NOTE: THIS MUST BE THE FIRST THING SET IN YOUR APPLICATION CONSTRUCTOR
InvokeManager.invokeManager.addEventListener(InvokeEvent.INVOKE, onInvoke );
}

private function onInvoke( event:InvokeEvent ):void
{
if( InvokeManager.invokeManager.startupMode == InvokeStartupMode.INVOKE )
{
//invoked as an application/target.
var data:InvokeRequest = InvokeManager.invokeManager.startupRequest;
}
else if( InvokeManager.invokeManager.startupMode == InvokeStartupMode.VIEWER )
{
//invoked as a viewer
var data:InvokeViewerRequest = InvokeManager.invokeManager.startupViewerRequest;
}
else
{
//launched by the pressing on the icon on the home screen.
}
}
}
}

 

Developer
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10
My Carrier: Verizon

Re: BB10 invocation framework - Empty event

What do you mean by "empty"? Have you traced all the attributes of the request?
Developer
Posts: 250
Registered: ‎03-14-2012
My Device: PlayBook 2.0
My Carrier: AT&T

Re: BB10 invocation framework - Empty event

Yes I traced all and the shared text is not in it.

The invocation event gets fired but as mentioned there is nothing in it.

 

What could I try?

Developer
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10
My Carrier: Verizon

Re: BB10 invocation framework - Empty event

There has to be something in the InvokeRequest object. At least the target invocation ID. Are you saying that it is null?
Developer
Posts: 250
Registered: ‎03-14-2012
My Device: PlayBook 2.0
My Carrier: AT&T

Re: BB10 invocation framework - Empty event

Yes, it's null! 

 

Developer
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10
My Carrier: Verizon

Re: BB10 invocation framework - Empty event

And your
startupMode == InvokeStartupMode.INVOKE
?

What is your XML target definition look like?
Developer
Posts: 250
Registered: ‎03-14-2012
My Device: PlayBook 2.0
My Carrier: AT&T

Re: BB10 invocation framework - Empty event

All are null!

 

This is my xml:

 

 <invoke-target id="com.myapp.blackberry.share">
 
    <icon>
  	<image>AppIconsForPublish/myicon_86.png</image>
  </icon> 
    <type>APPLICATION</type>
       <filter>
             <action>bb.action.SHARE</action>      
	       <mime-type>text/plain</mime-type>
	        <mime-type>*</mime-type>
	<property var="uris" value="data&colon;//, http://, https://"/>
</filter>
  </invoke-target>