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
New Contributor
Posts: 5
Registered: ‎01-15-2013
My Device: I am developer

Re: BB10 Invocation Tutorial

Thanks,

 

I try this code:

 

var request:InvokeRequest = new InvokeRequest();

request.target = "sys.browser";
request.action = "bb.action.OPEN";
request.mimeType = "text/html";
request.uri = "http://www.elespectador.com/";

InvokeManager.invokeManager.addEventListener(qnx.events.InvokeEvent.INVOKE_TARGET, onInvokeTarget );
InvokeManager.invokeManager.addEventListener(ErrorEvent.ERROR, onInvokeError );
InvokeManager.invokeManager.invoke( request );

 

I deploy app in BB10 emulator and real PlayBook but the web browser don´t open and handlers onInvokeTarget and onInvokeError are never called.

 

Then i don´t know that is wrong or that is laking. 

 

Thanks by your help!

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

Re: BB10 Invocation Tutorial

I know it wont work on the PlayBook - wrong OS version.
Dont need mimeType defined if you supplied the URI. Shouldn't need the callbacks either. Not certain what you would learn from those (are they being fired?).

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

Re: BB10 Invocation Tutorial

This worked fine in the simulator:

var request :InvokeRequest = new InvokeRequest();
request.action = InvokeAction.OPEN;
request.target = 'sys.browser';
request.uri = 'http://www.google.com';
InvokeManager.invokeManager.invoke( request );

 So did this:

var request :InvokeRequest = new InvokeRequest();
request.action = InvokeAction.OPEN;
request.uri = 'http://www.google.com';
InvokeManager.invokeManager.invoke( request );

 

Developer
Posts: 439
Registered: ‎10-25-2010
My Device: Not Specified

Re: BB10 Invocation Tutorial


jtegen wrote:
The core apps to target and how to invoke them are here:

https://developer.blackberry.com/air/documentation/bb10/invoking_core_apps.html

If you want to be invoked to edit an image, then you want to have the mime types set and the URIs to be 'file://'.

You may want to create a test client app that will invoke your app for testing. Some of this will make sense when you have to provide both sides. You can then also query targets based on different criteria, and if done right, your app should show up in the list of possible targets.

I am not certain if the apps and files system we currently have on the OS is fully invokable. I tested it a couple of versions ago and it was not there yet. I have not tested it on the latest one.

Thanks a bunch man, you are a rock :smileyhappy:

 

I'll put in some legwork on this and report back.

Developer
Developer
Posts: 226
Registered: ‎01-17-2012
My Device: PB

Re: BB10 Invocation Tutorial

Finally able to try invoking BBM on a DevAlpha, but nothing seems to work.

 

BBM working fine on the device, but I cannot invoke it from my app:

var viewer:InvokedViewer = new InvokedViewer();
{
	viewer.setActualSize( stage.stageWidth, stage.stageHeight );
				
	var bytes:ByteArray = new ByteArray();
	{
		bytes.writeUTF( html );
	}
        viewer.requestTarget( "660.216.0554", 'sys.bbm.sharehandler', "bb.action.SHARE", bytes );
}

 bar-descriptor has permission - bbm_connect

 

Regards,

 

I get no response or error...

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

Re: BB10 Invocation Tutorial

BBM is shared with cards:

var data :ByteArray = new ByteArray();
data.writeUTFBytes( text );
			
var request : InvokeRequest = new InvokeRequest();
request.action   = InvokeAction.SHARE;
request.target   = 'sys.bbm.sharehandler';
request.mimeType = 'text/plain';
request.data     = data;
			
InvokeManager.invokeManager.invoke( request );

 

Developer
Developer
Posts: 226
Registered: ‎01-17-2012
My Device: PB

Re: BB10 Invocation Tutorial

aside from UTF vs UTFBytes, what is different? How should the application deal with a Card vs Viewer?

 

Regards,

Developer
Developer
Posts: 226
Registered: ‎01-17-2012
My Device: PB

Re: BB10 Invocation Tutorial

I queried the InvokeManager:

InvokeManager.invokeManager.queryInvokeTargets( '*/*', '', InvokeAction.SHARE, InvokeTargetOptions.ALL );			

 and got the following:

query Share actionbb.action.SHARE sys.NFCViewer
target [NFC] icon=[/apps/sys.NFCViewer.gYABgFfBGdAX03rWRgo77YVGewg/public/native/icon.png]

 no BBM...

 

 

Developer
Developer
Posts: 226
Registered: ‎01-17-2012
My Device: PB

Re: BB10 Invocation Tutorial

if I widen the query to any action:

query  actionbb.action.SETUP sys.bbm
target [BBM] icon=[/apps/sys.bbm.gYABgLOJBR2Vz7FzS.kdgJchuag/public/native/bbmtarget.png]
query Share actionbb.action.SHARE sys.NFCViewer
target [NFC] icon=[/apps/sys.NFCViewer.gYABgFfBGdAX03rWRgo77YVGewg/public/native/icon.png]

 of course SETUP is not even defined as an InvokeAction nor is it listed in the BBM doc...

 

as mentioned earlier, BBM setup and working on the device...

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

Re: BB10 Invocation Tutorial

The target app decides what it can support and what it does not want to support. BBM has their own title bar and buttons that provide events back when complete (like the camera does). It is a lot less effort to integrate a card target since you do not have to deal with any gui, positioning, sizing, etc.