10-15-2012 09:38 AM - edited 10-15-2012 09:53 AM
Hi all,
I want to share QString data using Invocation. Following is what the snippet should be for using Invocation concept:
Button{
text: "Share"
onClicked: {
invoke.trigger("bb.action.SHARE")
}
attachedObjects: [
Invocation {
id: invoke
query: InvokeQuery {
mimeType: "text/txt"
uri: "Hello World"
invokeActionId: "bb.action.SHARE"
}
}
]
}
I don't get any error as this Invocation Framework is not function now in beta3 of BB10, but the property we have to provide is uri over here. i.e. QUrl. Isn;t there any other way apart from providing filepath for sharing??
Thanks in advance.
10-15-2012 02:58 PM
You should be using the data parameter of invocation instead of the uri parameter. https://developer.blackberry.com/cascades/referenc
10-16-2012 02:23 AM - edited 10-16-2012 02:30 AM
Hi,
Seeing https://developer.blackberry.com/cascades/referenc
Invocation {
id: invoke
query: InvokeQuery {
mimeType: "text/txt"
data: "Hello World"
invokeActionId: "bb.action.SHARE"
}
}
In this case, I get QML parsing Error stating: "Type mismatch of value of the 'data' property. Expecting QByteArray and found string"
10-16-2012 08:27 AM
try data: ["MyString"]
then it's an Array ;-)
10-17-2012 01:43 AM
Hi,
I tried data: ["mystring"] and following is the screen when I trigger the invocation. I think this isn't what I should be getting.
Instead I should be getting the one providing four ways of sharing i.e. BBM, BBM Group, Bluetooth and Tag. Previously I was achieving it when I was trying with uri: "file:///share.txt". I'm attaching its screenshot as well.
What I need is data..and not uri ! that's clear...but something is still going wrong, I'll be very thankful if you could help out.
10-17-2012 04:27 AM
Hi
Try the following
in C++
QByteArray MyClass::getByteArray(QString str)
{
return str.toAscii();
}
and set the context for QML
QmlDocument *qml = QmlDocument::create("asset:///main.qml").parent(th
qml->setContextProperty("app", this); /// this must point to MyClass
in QML
data: app.getByteArray("your_string")
10-18-2012 01:17 AM
10-24-2012 05:03 PM
10-26-2012 12:39 PM
mimeType: "text/plain" shows the BBM option
11-07-2012 11:10 AM
I would like to share a few lines of text including line breaks ("\n"). Is it possible?