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


Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.


Reply
Developer
Posts: 305
Registered: ‎02-14-2012
My Device: BlackBerry Passport / Nokia N950
My Carrier: -

Re: sharing data of type QString using Invocation Framework.

Thanks!

 

I will try it tonight using "text/plain" to share a text to all possible targets. It should be nearly the same? (data instead of uri)

 

Would be great to post a warning if I will fail when replacing the "image/png" with "text/plain", otherwise thanks for the post. Smiley Happy

 

Since you're a Admin, could you trigger please the right person to update

https://developer.blackberry.com/cascades/documentation/device_platform/invocation/invoking_core_app... with the example you shared? There is everything listet, but not the share dialog. Smiley Happy

 

Developer
Posts: 89
Registered: ‎10-18-2012
My Device: BB Z10
My Carrier: -

Re: sharing data of type QString using Invocation Framework.

Hi all!

 

I'm trying to do the same in C++, but only BBM Groups option appears. The same configuration in QML works fine and show multiple options.

 

InvokeManager invokeManager;
InvokeRequest request;
request.setAction("bb.action.SHARE");
request.setMimeType("text/plain");
request.setData( QString(title + " "+ link).toUtf8());
invokeManager.invoke(request);

 

Can anyone help me?

BlackBerry Development Advisor
Posts: 15,887
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
My Carrier: Bell

Re: sharing data of type QString using Invocation Framework.

sgallego84, refer to my code a few posts back in this thread.

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Developer
Posts: 89
Registered: ‎10-18-2012
My Device: BB Z10
My Carrier: -

Re: sharing data of type QString using Invocation Framework.

Thanks a lot!

I think documentation about this action is not very clear...

 

Regards!

Developer
Posts: 89
Registered: ‎10-18-2012
My Device: BB Z10
My Carrier: -

Re: sharing data of type QString using Invocation Framework.

I have followed MSohm 

 

Invocation *m_pInvocation = Invocation::create(
InvokeQuery::create().parent(this).mimeType("text/plain").data(
QString(title + " " + link).toLocal8Bit()));
QObject::connect(m_pInvocation, SIGNAL(armed()), this, SLOT(onArmed()));
QObject::connect(m_pInvocation, SIGNAL(finished()), m_pInvocation,
SLOT(deleteLater()));

 

I'm sharing spanish news titles, and some of them have accents. If I use UTF-8 encoding, email sharing doesn't show accents ok. If I use Latin1 or similar encoding, BBM and SMS sharing doesn't show accents ok... What can I do?

 

I have try:

.toLocal8Bit()
.toUtf8()
.toLatin1()
.toAscii()

 

Regards!

 

 

 

 

 

Highlighted
Developer
Posts: 276
Registered: ‎02-05-2010
My Device: Blackberry Z10
My Carrier: Bouygues Telecom

Re: sharing data of type QString using Invocation Framework.

Same troubles for me with unicode characters...

 

http://supportforums.blackberry.com/t5/Cascades-Development/Listview-items-with-unicode-characters/t...

 

Do you use the lastest ndk ?

Twitter : @LaurentKP
My apps
Developer
Posts: 89
Registered: ‎10-18-2012
My Device: BB Z10
My Carrier: -

Re: sharing data of type QString using Invocation Framework.

I have seen this issue, but the problem here is other...

Is like email app requires ascii encoding and SMS and BBM app requires UTF-8 encoding...

Developer
Posts: 305
Registered: ‎02-14-2012
My Device: BlackBerry Passport / Nokia N950
My Carrier: -

Re: sharing data of type QString using Invocation Framework.

I've the same problem with my App. I'm unable to share arabic encoded text to a email. Smiley Frustrated

Developer
Posts: 89
Registered: ‎10-18-2012
My Device: BB Z10
My Carrier: -

Re: sharing data of type QString using Invocation Framework.

Any idea??

BlackBerry Development Advisor
Posts: 15,887
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
My Carrier: Bell

Re: sharing data of type QString using Invocation Framework.

Text in QML is not in UTF-8 format.  Here's a workaround that allows you to use UTF-8 characters with accents in an invocation object. 

 

QML:
        InvokeActionItem {
            ActionBar.placement: ActionBarPlacement.OnBar
id: invokeTest title: "Share - C++ Formatted Data" query { mimeType: "text/plain; charset=utf-8" invokeActionId: "bb.action.SHARE"
onQueryChanged: invokeTest.query.updateQuery() } onTriggered: { data = cpp.encodeQString("Pourquoi ça ne marche pas?"); } } C++: QByteArray BBMShare::encodeQString(const QString& toEncode){ return toEncode.toUtf8(); }

 

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.