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
Posts: 298
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?

Highlighted
BlackBerry Development Advisor
Posts: 15,300
Registered: ‎07-09-2008
My Device: BlackBerry Passport
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.
Found a bug? Report it using Issue Tracker
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!

 

 

 

 

 

Developer
Posts: 275
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: 298
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,300
Registered: ‎07-09-2008
My Device: BlackBerry Passport
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.
Found a bug? Report it using Issue Tracker