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
connyhald
Posts: 102
Registered: ‎06-03-2012
My Device: Playbook
Accepted Solution

Sharing framework in Beta3

Hi guys,

 

could anyone already find some documentation about the sharing framework that should be available in Beta3? So far I've only found things related to sharing via NFC but not sharing via mail, twitter, bluetooth, etc..

 

Thanks,

Conny

 

-----------
http://kodira.de
BB Apps: Pattern :: Plonk
Please use plain text.
Developer
peter9477
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10

Re: Sharing framework in Beta3

I think the "sharing framework" which you mention is merely another case of using the Invocation Framework, with some predefined actions (perhaps bb.action.SHARE ?) and other parameters. If so, they are actively working on finishing documenting the entire set of such Invocation Framework uses and will have the docs for it posted shortly (I believe within a week or two at the most, based on what I heard yesterday).


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
connyhald
Posts: 102
Registered: ‎06-03-2012
My Device: Playbook

Re: Sharing framework in Beta3

Yea, your right (as usual :smileyhappy:). I found the docs and will give it a try now.

https://developer.blackberry.com/cascades/documentation/device_platform/invocation/sending_invocatio...

 

-----------
http://kodira.de
BB Apps: Pattern :: Plonk
Please use plain text.
Developer
connyhald
Posts: 102
Registered: ‎06-03-2012
My Device: Playbook

Re: Sharing framework in Beta3

Alright, so it basically seem to work. Still not everything makes sense to me yet...

 

If I call the InvocationManager from QML I can choose how I want to share the image. As options I have: BBM, BBM Group, Bluetooth, Tag.

InvokeActionItem {
    query {
        mimeType: "image/png"
        uri: "file:///<PATH_TO_FILE>"
        invokeActionId: "bb.action.SHARE"
    }
}

 

But if I call it from C++ I don't get the options list but instead I should directly choose a BBM User. So it's like I've pressed "BBM" in the QML example.

bb::system::InvokeManager *iManager = new bb::system::InvokeManager(this);
bb::system::InvokeRequest iRequest;
iRequest.setMimeType("image/png");
iRequest.setAction("bb.action.SHARE");
iRequest.setUri(QUrl::fromLocalFile(path));
bb::system::InvokeTargetReply *iReply = iManager->invoke(iRequest);

 Unfortunately I have to use C++ because I first have to do some processing of the file to share. Now I need to find out how to get the same result in C++ as in QML. If anyone knows: Hints are always welcome :smileyhappy:

 

-----------
http://kodira.de
BB Apps: Pattern :: Plonk
Please use plain text.
Super Contributor
Meghasanghvi
Posts: 306
Registered: ‎08-10-2010
My Device: Not Specified

Re: Sharing framework in Beta3

After adding the InvocationActionItem on a context menu i am able to see the share option on the menu. When i click on the share option i also get the screen which listed out BBM, BBM Group, NFC and bluetooth. When i select any of the option from this list i am not get any screen. I redirect to my application. 

 

If anyone have any idea about this.

Please use plain text.
Developer
connyhald
Posts: 102
Registered: ‎06-03-2012
My Device: Playbook

Re: Sharing framework in Beta3

In thd QML case only bluetooth worked partially for me. To get to the next screen I had to add the request URI as absolute file URI. E.g. file:///<absolute_path_to_image>

 

Still actually sending the image via bluetooth always fails for me.

 

-----------
http://kodira.de
BB Apps: Pattern :: Plonk
Please use plain text.
Super Contributor
Meghasanghvi
Posts: 306
Registered: ‎08-10-2010
My Device: Not Specified

Re: Sharing framework in Beta3

In my application nothing is work. I check all the option.

Do we need to handle click of listview which is by open when we click on  the share button.

Please use plain text.
Super Contributor
Meghasanghvi
Posts: 306
Registered: ‎08-10-2010
My Device: Not Specified

Re: Sharing framework in Beta3

Hi,

I attached my project in which when i click on button i fire the action of share.

Please check and if you have any idea.

Please use plain text.
Developer
connyhald
Posts: 102
Registered: ‎06-03-2012
My Device: Playbook

Re: Sharing framework in Beta3

In my case I've added the Action directly to the ActionBar, but I don't think that makes a difference. I've also experienced some wired behavior of this list that pops up. Sometimes I can select an entry, sometimes not. Also I only had success with the Bluetooth item and there also only after tapping it a couple of times and waiting a bit.

 

I think this functionality simply isn't ready yet. Probably we have to wait for the next update.

-----------
http://kodira.de
BB Apps: Pattern :: Plonk
Please use plain text.
Developer
connyhald
Posts: 102
Registered: ‎06-03-2012
My Device: Playbook

Re: Sharing framework in Beta3

Also, as I said, I had to use the complete absolute path. Not relative to the asset dir, like you do. To get that path I used QDir::current().absolutePath() in C++. Still, that's not really a great solution - and at the end it's still not really working...

-----------
http://kodira.de
BB Apps: Pattern :: Plonk
Please use plain text.