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
nhuanvd
Posts: 21
Registered: ‎12-11-2012
My Device: Blackberry Z10

Re: Invoking share card

Thanks for your help and nice tutorial.

New Member
robinkam
Posts: 1
Registered: ‎03-04-2013
My Device: BlackBerry Dev Alpha

Re: Invoking share card

You may try this which works for me perfectly:

ActionItem {
            ActionBar.placement: ActionBarPlacement.OnBar
            title: "Share"
            attachedObjects: [
                Invocation {
                    id: invoke
                    query: InvokeQuery {
                        id: invokeQuery
                        mimeType: "text/plain"
                        invokeTargetId: "sys.bbm.sharehandler"
                        invokeActionId: "bb.action.SHARE"
                        onQueryChanged: updateQuery()
                    }
                    onArmed: {
                        console.log(">>> onArmed: "+sharedText);
                        invokeQuery.data = sharedText;
                     }
                }
            ]
            onTriggered: {
                console.log(">>> onTriggered");
                invoke.trigger("bb.action.SHARE");
            }
        }

 

Developer
pradeep_ch
Posts: 543
Registered: ‎12-23-2010
My Device: Z10

Re: Invoking share card

Hi Macro,

 

How can I capture that the user has posted succesfully or clicked on cancel button on postwall screen.

 

Thanks.

Developer
TheMarco
Posts: 669
Registered: ‎02-19-2011
My Device: BlackBerry PlayBook 32GB

Re: Invoking share card

Good question. I'm not entirely sure if that's possible and if so ,how. Maybe someone else can chip in here?

Staff UI Prototyper (read: full-time hacker)


My BB10 apps: Screamager | Scientific RPN Calculator | The Last Weather App

Developer
slashkyle
Posts: 820
Registered: ‎10-16-2012
My Device: Red Z10

Re: Invoking share card

you could assign a property to onClicked() & update it when clicked so when the user clicks to share text your app is notified, i don't belive we can capture the cancel signal from the share invoaction page that would require custom building that section.

 

Container {
    property bool buttonClicked;
    Button {
        onClicked: {
            buttonClicked = true;
            //share text
        }
    }
}

 then you could have an onTouched function to say if they touch anywhere else other than the button, to change it's value back to false

New Contributor
k_waheed_kotb
Posts: 8
Registered: ‎07-20-2013
My Device: BB Z10, BB Q10

Re: Invoking share card

Your Awesome my friend, that's what I was seraching for :Clap: :Punk:

Trusted Contributor
Sankar_S
Posts: 139
Registered: ‎08-22-2013
My Device: None

Re: Invoking share card

thanks for sharing code link :smileyhappy: