01-09-2013 05:06 AM
Hi,
I am currently writing a sort of task list manager. However I was considering the ability to share a task with BBM contacts. A contact who would receive such a task could click it and then add it to his own app.
Could this be done over BBM?
Thanks in advance.
Solved! Go to Solution.
01-09-2013 12:06 PM
zezke wrote:
Hi,
I am currently writing a sort of task list manager. However I was considering the ability to share a task with BBM contacts. A contact who would receive such a task could click it and then add it to his own app.
Could this be done over BBM?
Thanks in advance.
this can be done with BBM
but not with the current implementation on BB10
I got the info that in OS versions after Launch youÄll be able to send app-specific data with BBM
(as you can already do with BB OS 7)
01-09-2013 12:11 PM
Thanks ekke!
01-10-2013 03:46 PM - edited 01-10-2013 03:59 PM
Streaming data from one application to another using BBM APIs is available for BBM on BlackBerry OS 5-7, but is not currently available on BlackBerry 10. It's something we're looking into post launch.
But you could accomplish this using the invocation framework for your app. You could create an InvokeActionItem that send a file with a custom extension/mime time over a BBM chat session in your app like this:
InvokeActionItem {
title: "Share Image Over BBM"
query {
invokeTargetId: "sys.bbm.sharehandler"
invokeActionId: "bb.action.SHARE"
uri: "file:///accounts/1000/shared/misc/file.tsk"
}
}
Your application would also need to register with the invocation framework as a handler for this extension/mime type. Then when the user receives the file, they could click on it to open the taskj in your app.
Not as seamless as streaming directly from one application to another, but it could be easier for now than buliding your own server infrastructure.
01-10-2013 03:55 PM
cool idea, Mark,
will try this out as a workaround.
01-11-2013 05:41 AM
Thanks Mark, works like a charm.
Some code snippets to help my fellow developers here.
bar-descriptor.xml
<invoke-target id="com.endare.toodleten">
<invoke-target-type>application</invoke-target-typ e>
<invoke-target-name>ToodleTen</invoke-target-name>
<icon>
<image>icon.png</image>
</icon>
<filter>
<action>bb.action.VIEW</action>
<action>bb.action.OPEN</action>
<mime-type>*</mime-type>
<property var="exts" value="tsk"/>
<property var="uris" value="file://,data://"/>
</filter>
</invoke-target>
InvokeActionItem:
InvokeActionItem {
title: "Share"
imageSource: "asset:///images/share.png"
query {
invokeTargetId: "sys.bbm.sharehandler"
invokeActionId: "bb.action.SHARE"
uri: "file:///accounts/1000/shared/misc/ToodleTen-Task. tsk"
}
}
And in my main app class:
//Invocation framework invokeManager = new InvokeManager(this); connect(invokeManager, SIGNAL(invoked(const bb::system::InvokeRequest&)), this, SLOT(onInvoked(const bb::system::InvokeRequest&))); //DO NOT FORGET TO FREE invokeManager!
void ToodleTen::onInvoked(const InvokeRequest& invoke)
{
qDebug() << "ToodleTen:: received invoke";
QUrl uri = invoke.uri();
qDebug() << "ToodleTen:: " << uri.toString();
QFile file(uri.toLocalFile());
if(file.open(QIODevice::ReadOnly))
{
QTextStream in(&file);
QString xml;
while(!in.atEnd())
{
xml = xml + in.readLine();
}
file.close();
qDebug() << "ToodleTen:: received xml " << xml;
QDomDocument doc;
doc.setContent(xml);
//... Process stuff here
}
}
02-05-2013 09:44 AM
Im stuck with this.
I've added in:
InvokeManager* invokeManager = new InvokeManager(this); connect(invokeManager, SIGNAL(invoked(const bb::system::InvokeRequest&)), this, SLOT(onInvoked(const bb::system::InvokeRequest&)));
To a class in my app.
I've added this to my bar descriptor:
<invoke-target id="com.MyAppId"> <invoke-target-type>application</invoke-target-type> <invoke-target-name>My App Name</invoke-target-name> <icon> <image>icon.png</image> </icon> <filter> <action>bb.action.VIEW</action> <action>bb.action.OPEN</action> <mime-type>*</mime-type> <property var="exts" value="tsk"/> </filter> </invoke-target>
I was wondering how I can test if my app invokes from another app? I have a file on my phone called test.tsk. How can I load it to see if my app loads?
Thanks
02-11-2013 03:19 PM
If you've sent the file over BBM, on the recipient device click on the grey folder type icon in the BBM chat message that has the file transfer. It should invoke the application registered to accept that file type.