02-16-2013 08:16 PM
Is there an example anywhere like the WebWorks 'Share Targets' one but for Cascades?
This is the example:
https://github.com/blackberry/BB10-WebWorks-Sample
I want to do this in a Cascades app but I'm not sure how. I saw a Facebook share example but I would like to pull up the share card so people can share something to any channel of their choice.
Any ideas?
Staff UI Prototyper (read: full-time hacker)
My BB10 apps: Screamager | Scientific RPN Calculator | The Last Weather App
Solved! Go to Solution.
02-16-2013 08:48 PM
this does it but onArmed is causing the share card to launch as soon as the app is started
Button {
attachedObjects: [
Invocation {
id: invoke
query: InvokeQuery {
id: invokeQuery
mimeType: "text/plain"
}
onArmed: {
invoke.trigger("bb.action.SHARE");
}
}
]
onClicked:{
invokeQuery.data = myTextArea.text;
invokeQuery.updateQuery();
}
02-16-2013 10:24 PM
This is what I'm using to invoke the share card
contextActions: [
ActionSet {
actions: [
InvokeActionItem {
title: "Share"
query {
mimeType: "text/plain"
invokeActionId: "bb.action.SHARE"
}
onTriggered: {
data = "This the text that is going to be shared"
}
}
]
}
]
here is a great example on that : http://www.bbcascades.com/index.php/tutorial-list/
Hope it helps
02-16-2013 11:08 PM - edited 02-16-2013 11:09 PM
is it possible to use the InvokeActionItem outside of context actions or a pre-defined menu(in a button or label)... that was how i was using it previously but I wanted to be able to instantly open the menu which required me to create my own, now that's done the reason i did it, doesnt work heh
02-16-2013 11:26 PM
Unfortunately none of these work for me.
The first one launches the card immediately (not desired) and the second one uses ActionItems. I don't have those. The invocation is supposed to happen when the user taps a button I defined...
Starting to wonder if this can be done in QML at all or whether I need C++?
Staff UI Prototyper (read: full-time hacker)
My BB10 apps: Screamager | Scientific RPN Calculator | The Last Weather App
02-16-2013 11:32 PM
02-16-2013 11:44 PM
Yeah it seems so. I just tried this which seems to make sense to me but... it crashes the app when tapping the button.
Button {
horizontalAlignment: HorizontalAlignment.Center
attachedObjects: [
Invocation {
id: invoke
query {
mimeType: "text/plain"
onQueryChanged: invoke.query.updateQuery()
}
}
]
onClicked: {
invoke.query.data = "This is it" + lastValue;
invoke.trigger("bb.action.SHARE");
}
text: qsTr("Send answer")
}
Staff UI Prototyper (read: full-time hacker)
My BB10 apps: Screamager | Scientific RPN Calculator | The Last Weather App
02-17-2013 07:37 PM
I got it to work with C++. Since this wasn't exactly easy for me I decided to write down what I did in a little tutorial for others to hopefully help.
https://forrst.com/posts/Adding_Social_Sharing_thr
Staff UI Prototyper (read: full-time hacker)
My BB10 apps: Screamager | Scientific RPN Calculator | The Last Weather App
02-17-2013 10:41 PM
Nice tutorial.
Thank you for sharing.
02-20-2013 04:22 PM