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

BB10 Invocation Tutorial

Really good article in using the invocation framework for AIR can be found here:

 

http://supportforums.blackberry.com/t5/Adobe-AIR-Development/Using-Invocation-Framework-in-Adobe-AIR...

 

:smileywink:

Please use plain text.
BlackBerry Development Advisor (Retired)
dmalik
Posts: 427
Registered: ‎02-22-2012
My Device: BlackBerry Z10, BlackBerry Dev Alpha C, BlackBerry PlayBook
My Carrier: Bell

Re: BB10 Invocation Tutorial

Thanks for taking the time to do this for the community! #BB10Believe

Follow me on Twitter: @dustinmalik
-----------------------------------------------------------------------------------------------------
Keep up to date on BlackBerry development: http://devblog.blackberry.com/
Please use plain text.
New Contributor
javison
Posts: 5
Registered: ‎01-15-2013
My Device: I am developer
My Carrier: Tigo

Re: BB10 Invocation Tutorial

Hi,

Thanks for your article.

 

I don´t now that is necessary all code related with UIComponent to build a CLIENT, the official BB10 documentation don´t say about it.

 

I try to use this class but when i run this functionallity i don´t receive any response, the listeners appears don´t work

 

My app needs to call the web browser to load any url.

 

Im working with Flash Builder 4.6 on Windows, i add invoke-target in bar-descriptor file, and create a instance of InvokedViewer and call method thus:

 

<invoke-target id="mimundo.games.m.tanico.me">
<type>VIEWER</type>
<filter>
<action>bb.action.OPEN</action>
<mime-type>application/x-app-type</mime-type>
</filter>
</invoke-target>

 

The id is my application ID

 

var data &colon; ByteArray = new ByteArray();

data.writeObject( {URI:'http://www.example.com/'});

var invoker : InvokerViewer = new InvokerViewer();
invoker.requestTarget("mimundo.games.m.tanico.me", 
"sys.browser", "bb.action.OPEN", data);

 

I`m testing it in BB10 simulator.

 

thanks for your help.

Please use plain text.
Developer
jtegen
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10
My Carrier: Verizon

Re: BB10 Invocation Tutorial

Are you trying to call yourself?

If you are opening the browser to a URL, see schema here:
https://developer.blackberry.com/air/documentation/bb10/browser.html

Not certain what you are doing in the execution of the code.
Please use plain text.
Developer
shawnblais
Posts: 439
Registered: ‎10-25-2010
My Device: Not Specified

Re: BB10 Invocation Tutorial

I've read the tutorial, but I still don't really understand how we're supposed to test this thing, or where the BB10 'schema's are hosted.

 

Simply put, I have a Photo Editor, and would like to edit Photo's that are sent my way. Is this even possible? All I need is a URL... I can do everything from there.

 

I know I could send a generic Invoke from some HelloWorld app, and maybe that would invoke my App, but what I really want to test is integration with the core OS / Gallery. Any way we can do that?

Please use plain text.
New Contributor
javison
Posts: 5
Registered: ‎01-15-2013
My Device: I am developer
My Carrier: Tigo

Re: BB10 Invocation Tutorial

Ok, understand, but i don´t know the difference in InvokedViewer.as between id and target parameters in 

public function requestTarget( id: String, target : String, action : String, data &colon; ByteArray ) : void

 

Please sayme that means.

 

Thanks you.

Please use plain text.
Developer
jtegen
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10
My Carrier: Verizon

Re: BB10 Invocation Tutorial

The InvokedViewer code sample was just to manage invoked targets that get embedded in an app. You would not use that when invoking a card.

The id is just id of the instance of the viewer (eg. 'byview1'), the target is the target ID of the nvocation target you want to embed in your app.

Hope that helps.
Please use plain text.
Developer
jtegen
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10
My Carrier: Verizon

Re: BB10 Invocation Tutorial

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.
Please use plain text.
New Contributor
javison
Posts: 5
Registered: ‎01-15-2013
My Device: I am developer
My Carrier: Tigo

Re: BB10 Invocation Tutorial

thanks again,

 

I need two things with invocation framework: 

 

1. Invoke the web browser to open specific url

2. Open Facebook App o Mail client to send image provided by my application

 

then i undestand that my targets for these purposes are: sys.browser and Facebook according to web page invoking_core_apps.html, then i don´t know if InvokedViewer its useful for this requirement.

 

One very important question is if i can test Invocation framework funcionalities in BB10 emulator? or i need test this in real device?

 

I try the functionallity described in this blackberry page https://developer.blackberry.com/air/documentation/bb10/sending_invocation.html#ufa1344348657118  but i can´t to see that the  target application open to provide your service. I test this code in BB10 emulator without good results because the target application never open.

 

Finally, if you can provide me any full and simple example with this functionality, I would appreciate.

 

Thanks

Please use plain text.
Developer
jtegen
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10
My Carrier: Verizon

Re: BB10 Invocation Tutorial

[ Edited ]

The InokeViewer class is only for embedding an app into your app. In the examples you gave, you would not need to use this since those apps would be an opened outside of your app as either a card or as a full app.

As far as I have seen, email invocation has not been published officially.

If the app is in the simulator, you can test it. You will have to wait to test Facebook, but its interface is pretty simple, so it should work as advertised.

That link will probably not work since the image viewer is not installed in the simulator or the current dev alpha device.

Once you create your request, you just need to invoke it to the invoke manager. Let me know if you need more.

Please use plain text.