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
gpheheise
Posts: 26
Registered: ‎07-17-2012
My Device: LE / DevAlphaC
My Carrier: vodafone

simple invocation of a Facebook page

hey guys 

 

does anyone have the code to how to invoke a facebook page?

have been able to do it with foursquare but still stuck with fb

 

many thanks for you help

interested in current apps?

http://appworld.blackberry.com/webstore/vendor/58298
Please use plain text.
Developer
slashkyle
Posts: 820
Registered: ‎10-16-2012
My Device: Red Z10
My Carrier: Telus

Re: simple invocation of a Facebook page

this link has the info for invoking applications, for facebook you could invoke it directly or invoke the browser & re-direct it to a specific facebook page

 

http://developer.blackberry.com/cascades/documentation/device_platform/invocation/invoking_core_apps...

Please use plain text.
New Developer
gpheheise
Posts: 26
Registered: ‎07-17-2012
My Device: LE / DevAlphaC
My Carrier: vodafone

Re: simple invocation of a Facebook page

jep i tried it with those infos but how does the code lines have to look like? 

 

the foursquare ones look like this:

 

        Invocation {

                id: fsqrInvoke

                query: InvokeQuery {

                        mimeType: "text/plain"

                        uri: "foursquare://venues/4b5af37df964a520e0db28e3"

                        invokeActionId: "bb.action.OPEN"

                }

        }

interested in current apps?

http://appworld.blackberry.com/webstore/vendor/58298
Please use plain text.
Developer
slashkyle
Posts: 820
Registered: ‎10-16-2012
My Device: Red Z10
My Carrier: Telus

Re: simple invocation of a Facebook page

[ Edited ]

I don't have a sample but, i read over the Facebook docs & if you're trying to bring up your page, you'll need

to set the metadata of the request object to a QVariantMap that contains the following entries:

 

QVariantMap payload;
 
payload["object_type"] = "page";
payload["object_id"] = "328506290597521";  // BlackBerry NA Facebook page
 
request.setMetadata(payload);

 

 
you might have to do it through c++ though
 
the browser seems to be simpler
 
Button {
    attachedObjects: [
        Invocation {
            id: invoke
            mimeType: "text/html"
            uri: "http://www.facebook.com"
            targetId: sys.browser

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

 

 

Please use plain text.
New Developer
gpheheise
Posts: 26
Registered: ‎07-17-2012
My Device: LE / DevAlphaC
My Carrier: vodafone

Re: simple invocation of a Facebook page

this will open the browser - for that I even have an easier way: 

 

        Invocation {

                id: fbInvoke

                query: InvokeQuery {

                        mimeType: "text/html"

                        uri: "http://facebook.com/thecoffeeshophamburg"

                        invokeActionId: "bb.action.OPEN"

                }

        }

 

 

but I want to open it in the native fb app

interested in current apps?

http://appworld.blackberry.com/webstore/vendor/58298
Please use plain text.
Developer
slashkyle
Posts: 820
Registered: ‎10-16-2012
My Device: Red Z10
My Carrier: Telus

Re: simple invocation of a Facebook page

using c++ 

 

void InvokeApp::invokeFacebook(){
	InvokeManager invokeManager;
	InvokeRequest request;
	request.setTarget("com.rim.bb.app.facebook");
	request.setAction("bb.action.OPEN");
	QVariantMap payload;

	payload["object_type"] = "page";
	payload["object_id"] = "328506290597521";  // BlackBerry NA Facebook page

	request.setMetadata(payload);
	invokeManager.invoke(request);
}
Please use plain text.