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
trivedirujuta
Posts: 528
Registered: ‎10-06-2009
My Device: 9800,BB Dev Alpha,z10 limited edition
My Carrier: Vodafone

Share text over bbm on click on imagebutton

[ Edited ]

Hi,

 

I want to share some text over bbm when click on my imagebutton.The imagebutton is in customdialog.How is it possible? can someone provide example?I searched on forum but everyone has used menu,actionbars.

Rujuta Trivedi
Please use plain text.
Developer
trivedirujuta
Posts: 528
Registered: ‎10-06-2009
My Device: 9800,BB Dev Alpha,z10 limited edition
My Carrier: Vodafone

Re: Share text over bbm on click on imagebutton

can somebody please help me?

Rujuta Trivedi
Please use plain text.
Developer
ekke
Posts: 1,422
Registered: ‎04-08-2010
My Device: Z10 (red Limited Edition), Q10, Z30
My Carrier: Telekom.de, O2, Vodafone

Re: Share text over bbm on click on imagebutton

take a look at the doc of dialogs

if you hjave a SystemDialog you get a signal if finished

https://developer.blackberry.com/cascades/reference/bb__system__systemdialog.html#finished

 

you can ask the ResultType for the clicked button, per ex

https://developer.blackberry.com/cascades/reference/bb__system__systemuiresult.html#custombuttonsele...

 

-------------------------------------------------------------------------------
ekke (independent software architect, rosenheim, germany)

BlackBerry Elite Developer
International Development Mobile Apps BlackBerry 10 Cascades
Cascades - Workshops / Trainings / Bootcamps

Open Source Enthusiast
blog: http://ekkes-corner.org videos: http://www.youtube.com/user/ekkescorner
bb10-development: http://appbus.org Twitter: @ekkescorner
Please use plain text.
Developer
trivedirujuta
Posts: 528
Registered: ‎10-06-2009
My Device: 9800,BB Dev Alpha,z10 limited edition
My Carrier: Vodafone

Re: Share text over bbm on click on imagebutton

I know about the systemdialog functions. My question is how to use invokeactionitem in that?

Rujuta Trivedi
Please use plain text.
Developer
ekke
Posts: 1,422
Registered: ‎04-08-2010
My Device: Z10 (red Limited Edition), Q10, Z30
My Carrier: Telekom.de, O2, Vodafone

Re: Share text over bbm on click on imagebutton

I'm calling this C++ code:

void OpenDataSpace::shareTextWithBBM(const QString& text){
        InvokeRequest bbmRequest;
	bbmRequest.setTarget("sys.bbm.sharehandler");
	bbmRequest.setAction("bb.action.SHARE");
	bbmRequest.setData(text.toUtf8());
	qDebug() << "share with BBM: " << text;
	mInvokeManager->invoke(bbmRequest);
}

 

-------------------------------------------------------------------------------
ekke (independent software architect, rosenheim, germany)

BlackBerry Elite Developer
International Development Mobile Apps BlackBerry 10 Cascades
Cascades - Workshops / Trainings / Bootcamps

Open Source Enthusiast
blog: http://ekkes-corner.org videos: http://www.youtube.com/user/ekkescorner
bb10-development: http://appbus.org Twitter: @ekkescorner
Please use plain text.
Developer
trivedirujuta
Posts: 528
Registered: ‎10-06-2009
My Device: 9800,BB Dev Alpha,z10 limited edition
My Carrier: Vodafone

Re: Share text over bbm on click on imagebutton

can you explain it in qml

Rujuta Trivedi
Please use plain text.
Developer
bcs925
Posts: 262
Registered: ‎07-13-2012
My Device: PlayBook, DA B, DA C, LE Z10 #102, Q10, Z30
My Carrier: T-Mobile

Re: Share text over bbm on click on imagebutton

[ Edited ]

I'd start here: http://bbcascadescode.tumblr.com/post/38998702671/invoke-share-for-bb10

 

Then instead of making it an action item, you should be able to do something like:

 

ImageButton {
                   ...
                   attachedObjects: [

                       Invocation {
                           id: invoke
                           query: InvokeQuery {
                               mimeType: "text/plain"
                               data&colon; "Whatever text you want to share"
                           }
                       }
                   ]

                   onClicked: {
                      
                       invoke.trigger("bb.action.SHARE")
                   }
               }

 

---
Check out my BB10 Cascades Coding site: BBcascades.com & Cascades Blog: bbcascadescode.tumblr.com

My Built for BlackBerry app: The Dive Plan
Please use plain text.
Developer
trivedirujuta
Posts: 528
Registered: ‎10-06-2009
My Device: 9800,BB Dev Alpha,z10 limited edition
My Carrier: Vodafone

Re: Share text over bbm on click on imagebutton

Thanks,

 

I have done it just before few mins. Now the problem is the text is not prepopulated when I open BBM and select contact.

Rujuta Trivedi
Please use plain text.
Developer
bcs925
Posts: 262
Registered: ‎07-13-2012
My Device: PlayBook, DA B, DA C, LE Z10 #102, Q10, Z30
My Carrier: T-Mobile

Re: Share text over bbm on click on imagebutton

[ Edited ]

whatever you have have in the data&colon; "" line is what will be prepopulated.

 

EDIT - I don't know why it showing &colon; instead of an actual colon and when I try to fix it it wont... but it should not be words, rather the actual symbol

---
Check out my BB10 Cascades Coding site: BBcascades.com & Cascades Blog: bbcascadescode.tumblr.com

My Built for BlackBerry app: The Dive Plan
Please use plain text.
Developer
trivedirujuta
Posts: 528
Registered: ‎10-06-2009
My Device: 9800,BB Dev Alpha,z10 limited edition
My Carrier: Vodafone

Re: Share text over bbm on click on imagebutton

Its not getting populated. I have done exact as you have mentioned in code

Rujuta Trivedi
Please use plain text.