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.

Reply
Retired
rymcdonald
Posts: 150
Registered: ‎01-17-2012
My Device: BlackBerry Z10

Invocation Framework

This thread is reserved for questions or comments relating to the "Invocation Framework" online lesson and lab.

Developer
YamilBracho
Posts: 713
Registered: ‎05-31-2010
My Device: 8520

Re: Invocation Framework

Some typos found:

 

Slide "Multiple Targets Code Sample 2"
   QString targetId = targets[i].name();
Should be 	
   QString targetId = targets[j].name();
   
Slide "Handling  Invocations"
   connect( invokeManager, 
	  SIGNAL(invoked(const bb::system::InvokeRequest&),
	  &myApp,
	  SLOT(onInvoke(const bb::system::InvokeRequest&))
Should be 	
   connect( invokeManager, 
	  SIGNAL(invoked(const bb::system::InvokeRequest&)),
	  &myApp,
	  SLOT(onInvoke(const bb::system::InvokeRequest&)))
	  
Slide "Invoke in QML: Unbound Invocation"
   InvokeActionItem { query {
               mimeType: "image/png"
			   invokedActionId: "bb.action.OPEN"
			   uri: file:///.../image.png}}
Should be 	
   InvokeActionItem { query {
               mimeType: "image/png"
			   invokedActionId: "bb.action.OPEN"
			   uri: "file:///.../image.png"}}
			   
Slide "Invoke in QML: Unbound Invocation"
   invokeAction.setUri("file:///.../
Should be 	
   invokeAction.setUri("file:///.../");
   
Slide "Invoke in QML: Bound Invocation"
   InvokeActionItem { query {
               invokeTargetId: "com.example.image.view" 
               mimeType: "image/png"
			   invokedActionId: "bb.action.OPEN"
			   uri: file:///.../image.png}}
Should be 	
   InvokeActionItem { query {
               invokeTargetId: "com.example.image.view" 
               mimeType: "image/png"
			   invokedActionId: "bb.action.OPEN"
			   uri: "file:///.../image.png"}}
			   
Slide "Invoke in QML: Bound Invocation"
   invokeAction.setUri("file:///.../
Should be 	
   invokeAction.setUri("file:///.../");
   
				   
	  
	  
   

 

Retired
rymcdonald
Posts: 150
Registered: ‎01-17-2012
My Device: BlackBerry Z10

Re: Invocation Framework

@YamilBracho - very good eye!  We've corrected all of these minor typos and republished the course.  Thanks. :smileyhappy:

Developer
gustavoja
Posts: 15
Registered: ‎01-02-2012
My Device: playbook

Re: Invocation Framework

Hello Ryan is Gustavo from de Cascades developer course in orlando

 

Hope you're doing great.

 

I'm working right now with the invocation framework,  i've created a group data model to store the info of the possibles app to invoke for share a picture.

I populate the data model with no problem, include the .label, the .name and .icon of each target.

 

But then when i try to use the icon with the url provided by the target app and my app says it can't be found.

 

i.e. 

Im receiving this url for foursquare

 

 "/apps/com.foursquare.blackberry.gYABgBY3zYaCRi7CDRw5ChZRJ18/public/native/icon.png"

 

This is the log error:

 

Aug 09 00:17:16.274 com.example.Camculator.testDev__Camculatorfdc2d092.9199832 default 9000 WARNING Image not found: "/apps/com.foursquare.blackberry.gYABgBY3zYaCRi7CDRw5ChZRJ18/public/native/icon.png"

 

And it's happening with every other inoked targets, bbm, whatsapp etc.

 

What could be the problem? do i need any extra permission for that or it's an URL problem?

 

Thank you!

 

Contributor
shopen
Posts: 13
Registered: ‎04-02-2013
My Device: Z10

Re: Invocation Framework

I have that icon on my system, and it seems to be accessible.

You might check by ssh'ing to the target and looking for it. This is how i checked: 

$ cd /apps/com.foursquare.blackberry.gYABgBY3zYaCRi7CDRw5ChZRJ18/public/native

$ ls -l
total 944
-rw-r--r-- 2 apps 10003 187208 Jun 13 18:43 default.png
-rw-r--r-- 2 apps 10003 18285 Jun 13 18:42 icon.png
-rw-r--r-- 2 apps 10003 277206 Jun 13 18:43 n-default.png
$ cp icon.png /accounts/1000/shared/photos/icon.png
$

 

And then i looked at the icon in my photos just to be sure. 

 

How are you using the icon? 

You might need a "file:" before the path.

Developer
gustavoja
Posts: 15
Registered: ‎01-02-2012
My Device: playbook

Re: Invocation Framework - URL PROBLEM

Ok i found it

 

I tried with my Z10 and the icon were shown but in the dev alpha not! 

 

So i checked the os version of the dev alpha is 10.1.0.1483 and the z10 is 10.0.10.690

 

The previous os version when you're trying to find a file outside of your app directories you have to append "file://" to reach it. I knew that but it never saw the double colon i was trying with "file://", my bad

 

so the code would be like this

 

QString direc="file://"+target.icon().toString(); //append the file://

QVariantMap entry;
entry["imageSource"] = direc; // insert the information int the entry for the groupdatamodel

m_model->insert(entry);//insert the entry int the datamodel

 

direc will take this vale for foursquare

 "file:///apps/com.foursquare.blackberry.gYABgBY3zYaCRi7CDRw5ChZRJ18/public/native/icon.png"

 

then read it in my list item in qml

 

ListView {
id:model
dataModel: model

 

listItemComponents: [
ListItemComponent {
 StandardListItem {
 title: ListItemData.label
 imageSource: ListItemData.imageSource
}}]} ...

 

attachedObjects: [

GroupDataModel {
id: model
objectName: "modelo"
}

 

 "file:///apps/com.foursquare.blackberry.gYABgBY3zYaCRi7CDRw5ChZRJ18/public/native/icon.png"

 

This work!

 

Thank you

Developer
gustavoja
Posts: 15
Registered: ‎01-02-2012
My Device: playbook

Re: Invocation Framework

Thank you my friend

 

You can se my response down there.