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
New Developer
Posts: 4
Registered: ‎04-05-2012
My Device: Blackberry 9300
My Carrier: Vodacom SA

Invoke Twitter

Can anyone help me to invoke a twitter profile in cascades? The invoke sample apps does not help me? I would really appreciate it if anyone could help me step by step. Thanks

Retired
Posts: 54
Registered: ‎06-26-2012
My Device: BlackBerry Bold 9900
My Carrier: Bell

Re: Invoke Twitter

Please read "Here are the invocation attributes you use to open a Twitter profile:" in
https://developer.blackberry.com/cascades/documentation/device_platform/invocation/twitter.html

Developer
Posts: 206
Registered: ‎05-15-2012
My Device: None
My Carrier: Telus

Re: Invoke Twitter

[ Edited ]

That code does not work. The documentation appears to be wrong (or there is a bug in the invocation framework/twitter app).

 

http://supportforums.blackberry.com/t5/Cascades-Development/Invoking-a-Twitter-Profile/m-p/2310465

 

I never did log an issue in the JIRA tracker because the page timed out after I wrote the entire ticket, and the page didn't cache the fields -_-

 

Right now there appears to be no way to successfully invoke a twitter profile.

 

If you do figure this out, let me know.

----------------------
Check out my app, Alien Flow for reddit

And of course, like my post if you found it helpful or informative!
Retired
Posts: 85
Registered: ‎05-25-2012
My Device: Limited Edition Z10
My Carrier: Bell

Re: Invoke Twitter

Have you looked at the sample here:

 

https://github.com/blackberry/Cascades-Samples/tree/master/socialinvocation

 

You just need to create an instance of the InvocationManager:

 

    bb::system::InvokeManager* m_invokeManager;

 And instantiate it in the constructor:

 

m_invokeManager(new InvokeManager(this)) 

 Then create the Invocation Request and invoke:

 

InvokeRequest request;

request.setTarget("com.twitter.urihandler");
request.setAction("bb.action.VIEW");
request.setUri("twitter:connect:blackberrydev");

m_invokeManager->invoke(request);

 And don't forget to include the headers:

 

#include <bb/system/InvokeManager>
#include <bb/system/InvokeRequest>

 

 

New Developer
Posts: 9
Registered: ‎04-30-2013
My Device: Z10
My Carrier: Bell

Re: Invoke Twitter

is there a way to do it using QML ??

lets start by making a nice looking app !!
Retired
Posts: 85
Registered: ‎05-25-2012
My Device: Limited Edition Z10
My Carrier: Bell

Re: Invoke Twitter

No, currently you can only Share content to Twitter using QML. 

 

You need the Invocation Manager in order to invoke the Twitter app, and you need C++ in order to create the Invocation Manager.

New Developer
Posts: 9
Registered: ‎04-30-2013
My Device: Z10
My Carrier: Bell

Re: Invoke Twitter

thanks for the fas response I applied the C++ code but how can I call the invocation in QML I mean like ("_twitterInvoke") or what ??

thanks for the help
lets start by making a nice looking app !!
Retired
Posts: 85
Registered: ‎05-25-2012
My Device: Limited Edition Z10
My Carrier: Bell

Re: Invoke Twitter

Check out the Social Invocation sample:

 

https://github.com/blackberry/Cascades-Samples/tree/master/socialinvocation

 

You'll see in main.cpp we set the context property for the QML to reference our C++ code:

 

QmlDocument *qml = QmlDocument::create("asset:///main.qml").parent(&app);
qml->setContextProperty("_socialInvocation", new SocialInvocation(&app));

 Then in main.qml you will see the app's invoke function being called:

 

_socialInvocation.invoke("com.rim.bb.app.facebook", "bb.action.OPEN", fbGroup.selectedValue, txtFBProfile.text)

 

New Developer
Posts: 9
Registered: ‎04-30-2013
My Device: Z10
My Carrier: Bell

Re: Invoke Twitter

I get an error message "ReferenceError: Can't find variable: _socialInvocation' " very odd
lets start by making a nice looking app !!
Retired
Posts: 85
Registered: ‎05-25-2012
My Device: Limited Edition Z10
My Carrier: Bell

Re: Invoke Twitter

Did you set the context property so the QML can reference the C++?

 

Can you post your C++ code that sets the context property and the QML that references it?