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
Developer
bbquincar
Posts: 304
Registered: ‎08-14-2012
My Device: PlayBook, Z10, Dev C
My Carrier: Rogers
Accepted Solution

Invocation attributes for app world

I have the code below that is show as a double in my app on the dev alpha, but on the sim it shows at one. Can some one tell me what im doing wrong please thanks. Its an Invocation to open app world.

 

      InvokeActionItem {
            title: "Leave a Review"
            ActionBar.placement: ActionBarPlacement.InOverflow
            imageSource: "images/Spaceship.png"
            query {
                mimeType: "application/x-bb-appworld"
                uri: "appworld://content/133047"
            }
            onTriggered: {
                invoke.trigger("bb.action.OPEN")
            }
        }

 

BlackBerry 10 game reviews for the unknown, small and indie developers. Little games with big dreams. VeryBerryGames.com | Follow @VeryBerryGames | TwoCasualCoders.com | never casual on quality
Please use plain text.
Developer
bbquincar
Posts: 304
Registered: ‎08-14-2012
My Device: PlayBook, Z10, Dev C
My Carrier: Rogers

Re: Invocation attributes for app world

      ActionItem {
            title: "Leave A Review"
            imageSource: "asset:///images/"
            onTriggered: {
                invokeLeaveReview.trigger("bb.action.OPEN");
            }
        }
    ]
    attachedObjects: [
        Invocation {
            id: invokeLeaveReview
            query: InvokeQuery {
                mimeType: "application/x-bb-appworld"
                uri: "appworld://content/133047"
            }
        }
    ]

 figured it out

BlackBerry 10 game reviews for the unknown, small and indie developers. Little games with big dreams. VeryBerryGames.com | Follow @VeryBerryGames | TwoCasualCoders.com | never casual on quality
Please use plain text.
Developer
peter9477
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10
My Carrier: none

Re: Invocation attributes for app world

You can do this without the trigger handler too:

InvokeActionItem {
    title: "Leave a Review"
    ActionBar.placement: ActionBarPlacement.InOverflow
    query {
        invokeTargetId: "sys.appworld"
        invokeActionId: "bb.action.OPEN"
        uri: "appworld://content/....."
    }
}

Also note that the above is the correct targetId to use. Not sure what the effect is of using the mime type but it seems unnecessary given that this is documented. https://developer.blackberry.com/cascades/documentation/device_platform/invocation/blackberry_world....


Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
Please use plain text.
Developer
bbquincar
Posts: 304
Registered: ‎08-14-2012
My Device: PlayBook, Z10, Dev C
My Carrier: Rogers

Re: Invocation attributes for app world

not sure it was a bug or not but i double review buttons when i used the first sample.

once would push to app world the other would open up NFC not sure while. 

BlackBerry 10 game reviews for the unknown, small and indie developers. Little games with big dreams. VeryBerryGames.com | Follow @VeryBerryGames | TwoCasualCoders.com | never casual on quality
Please use plain text.
Developer
peter9477
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10
My Carrier: none

Re: Invocation attributes for app world

It's not a bug, and I saw the same behaviour when I tried your code. With mine, you don't get that.

The reason it's not a bug is, I think, because you're underspecifying the query, so the Invocation Broker is finding multiple "paths" to meet the criteria you supplied, which appears to come up with both SHARE and OPEN actions. They both end at BB World, but from the invocation framework's point of view they are not performing the same action so they get separate buttons.

If you put the action in there explicitly, you get only the one button. You can see that specifying SHARE gets you the one icon, and OPEN gets you the other one (unless you override the default icon as you did, so maybe you never noticed that).

Anyway, what I showed doesn't have the problem.

Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
Please use plain text.
Developer
bbquincar
Posts: 304
Registered: ‎08-14-2012
My Device: PlayBook, Z10, Dev C
My Carrier: Rogers

Re: Invocation attributes for app world

Thanks for the explaintion great
BlackBerry 10 game reviews for the unknown, small and indie developers. Little games with big dreams. VeryBerryGames.com | Follow @VeryBerryGames | TwoCasualCoders.com | never casual on quality
Please use plain text.