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

Reply
Trusted Contributor
Vibes
Posts: 223
Registered: ‎03-14-2012
My Device: PlayBook 2.0

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
jtegen
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10

Re: BB10 invocation framework - Empty event

What do you mean by "empty"? Have you traced all the attributes of the request?
Trusted Contributor
Vibes
Posts: 223
Registered: ‎03-14-2012
My Device: PlayBook 2.0

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
jtegen
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10

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?
Trusted Contributor
Vibes
Posts: 223
Registered: ‎03-14-2012
My Device: PlayBook 2.0

Re: BB10 invocation framework - Empty event

Yes, it's null! 

 

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

Re: BB10 invocation framework - Empty event

And your
startupMode == InvokeStartupMode.INVOKE
?

What is your XML target definition look like?
Trusted Contributor
Vibes
Posts: 223
Registered: ‎03-14-2012
My Device: PlayBook 2.0

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>