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

Native Development

Reply
Highlighted
Developer
Posts: 15
Registered: ‎01-02-2012
My Device: playbook
My Carrier: digitel
Accepted Solution

Invocation framework icon problem

Hello

 

I'm having this problem, i've created a group data model to get 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.

 

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?

 

Thanks

Developer
Posts: 271
Registered: ‎05-29-2013
My Device: BlackBerry Z10
My Carrier: MTS

Re: Invocation framework icon problem

Could you show the code which works and which is not? Also, have you tried to give Shared File permission to your app?
-------------------------------------------------------------------------------
NSR Reader for BlackBerry 10 @NSRReader on Twitter
Me @xelfium on Twitter
Developer
Posts: 15
Registered: ‎01-02-2012
My Device: playbook
My Carrier: digitel

Re: Invocation framework icon problem - 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