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
ekke
Posts: 1,421
Registered: ‎04-08-2010
My Device: Z10 (red Limited Edition), Q10, Z30
My Carrier: Telekom.de, O2, Vodafone

Re: sharing data of type QString using Invocation Framework.


georg22 wrote:

I would like to share a few lines of text including line breaks ("\n"). Is it possible?


of course you can include
\n

in your text and provide thru Invocation Framework

-------------------------------------------------------------------------------
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.
Administrator
MSohm
Posts: 14,268
Registered: ‎07-09-2008
My Device: BlackBerry Z30, BlackBerry PlayBook
My Carrier: Bell

Re: sharing data of type QString using Invocation Framework.

If you wish to start a BBM Chat sharing data, you can do it like this:

 

InvokeActionItem {
            title: "Share Text Over BBM"
            query {
                mimeType: "text/plain"
                invokeTargetId: "sys.bbm.sharehandler"
                invokeActionId: "bb.action.SHARE"
                data: "This is some text to share."
            }
        }

 

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Please use plain text.
Developer
ekke
Posts: 1,421
Registered: ‎04-08-2010
My Device: Z10 (red Limited Edition), Q10, Z30
My Carrier: Telekom.de, O2, Vodafone

Re: sharing data of type QString using Invocation Framework.


MSohm wrote:

If you wish to start a BBM Chat sharing data, you can do it like this:

 

InvokeActionItem {
            title: "Share Text Over BBM"
            query {
                mimeType: "text/plain"
                invokeTargetId: "sys.bbm.sharehandler"
                invokeActionId: "bb.action.SHARE"
                data: "This is some text to share."
            }
        }

 


I read that query attributes are read-only
So - if data isn't static, I'm doing it his way:
InvokeActionItem {
            id: shareAction
            ActionBar.placement: ActionBarPlacement.OnBar
            query {
                mimeType: "image/png"
                invokeActionId: "bb.action.SHARE"
                invokeTargetId: "io.ods.bb10.card.upload.previewer"
            }
            onTriggered: {
                // trick: all properties from query are read-only
                // but we can use the data, which is read-write
                data = picker.selectedFile
            }
        }

 

 

 

-------------------------------------------------------------------------------
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
Kaz32
Posts: 236
Registered: ‎11-24-2012
My Device: Blackberry 10 Dev Alpha
My Carrier: Telkomsel

Re: sharing data of type QString using Invocation Framework.

Hi, if I want to share text to BBM group how to do that??

 

if I comment 

invokeTargetId: "sys.bbm.sharehandler"

there is a list and can choose for BBM group

But if I want directly to bbm group how to do that?

 

Is invokeTargetId must change to something??

 

Can I get the complete list for 

- invokeTargetId

- InvokeActionId

- mimeType

 

all value that posible for that properties

 

Thanks

Please use plain text.
Contributor
base8
Posts: 26
Registered: ‎06-27-2012
My Device: Playbook
My Carrier: n/a

Re: sharing data of type QString using Invocation Framework.

[ Edited ]

Yes, it would be nice to know how to specifically invoke BB Group, Text message, Email, etc. RIM needs to have more complete documentation on this. They focus too much on sharing over BBM and neglect other built-in share methods.

Please use plain text.
Developer
laurentC
Posts: 266
Registered: ‎02-05-2010
My Device: Blackberry Z10
My Carrier: Bouygues Telecom

Re: sharing data of type QString using Invocation Framework.

InvokeActionItem {
  id: invoke2
query {
  mimeType: "text/plain"
  invokeActionId: "bb.action.SHARE"
 }
 onTriggered: {
  data = [textConv.text]
 }

}

 

I think the code above should work ! The invocation framework should prompt the user with the right apps to share some text : BBM, text message, email,...

Unfortunatly when you run this code on the alpha device, only 3 options are available : BBM, BBM Group and NFC. I think (and I hope) it's because all apps are not installed...

Twitter : @LaurentKP
My apps
Please use plain text.
Contributor
base8
Posts: 26
Registered: ‎06-27-2012
My Device: Playbook
My Carrier: n/a

Re: sharing data of type QString using Invocation Framework.

I need to be able to specifically invoke SMS only. Is there a specific invokeTargetId for that?

Please use plain text.
Administrator
MSohm
Posts: 14,268
Registered: ‎07-09-2008
My Device: BlackBerry Z30, BlackBerry PlayBook
My Carrier: Bell

Re: sharing data of type QString using Invocation Framework.


Kaz32 wrote:

Hi, if I want to share text to BBM group how to do that??

 

if I comment 

invokeTargetId: "sys.bbm.sharehandler"

there is a list and can choose for BBM group

But if I want directly to bbm group how to do that?

 

Is invokeTargetId must change to something??

 

Can I get the complete list for 

- invokeTargetId

- InvokeActionId

- mimeType

 

all value that posible for that properties

 

Thanks


sys.bbgroups.sharehandler  is the target id for BBM Groups.  Here are a couple of examples on how to share text or an image with a BBM group.  The user will be prompted to select the group to share with.

 

InvokeActionItem {
    title: "Share Text Over BBM Group"
    query {
        mimeType: "text/plain"
        invokeTargetId: "sys.bbgroups.sharehandler"
        invokeActionId: "bb.action.SHARE"
        data: "This is some text to share in a group."
    }
},
InvokeActionItem {
    title: "Share Image Over BBM Group"
    query {
        invokeTargetId: "sys.bbgroups.sharehandler"
        invokeActionId: "bb.action.SHARE"
        uri: "file:///accounts/1000/shared/photos/avatar.png"
    }
}

 

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Please use plain text.
Developer
helex
Posts: 274
Registered: ‎02-14-2012
My Device: Nokia N950 / BB Playbook
My Carrier: -

Re: sharing data of type QString using Invocation Framework.


MSohm wrote:

Kaz32 wrote:

Hi, if I want to share text to BBM group how to do that??

 

if I comment 

invokeTargetId: "sys.bbm.sharehandler"

there is a list and can choose for BBM group

But if I want directly to bbm group how to do that?

 


I'm running it from within my C++ code and don't get such a list to select the target. It shares only directly to BBM.

What have I to use to get the Dialog to share via BBM, SMS, Mail, Bluetooth, NFC, ... ?

 

Please use plain text.
Administrator
MSohm
Posts: 14,268
Registered: ‎07-09-2008
My Device: BlackBerry Z30, BlackBerry PlayBook
My Carrier: Bell

Re: sharing data of type QString using Invocation Framework.

This code will bring up the dialog asking the user to choose the application they wish to use to share.

 

void BBMInvocation::shareImageBound()
{

	QString path = QDir::current().absoluteFilePath("shared/photos/avatar.png");

	m_pInvocation = Invocation::create(
			InvokeQuery::create().parent(this).mimeType("image/png").uri(
					QUrl::fromLocalFile(path)));

	QObject::connect(m_pInvocation, SIGNAL(armed()), this, SLOT(onArmed()));

	QObject::connect(m_pInvocation, SIGNAL(finished()), m_pInvocation,
			SLOT(deleteLater()));

}

void BBMInvocation::onArmed()
{
	m_pInvocation->trigger("bb.action.SHARE");
}

 

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Please use plain text.