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

Posts: 79
Registered: ‎09-22-2010
My Device: 9700

PlayBook facebook SDK


while Developers like me are now shifting From BB Java to Playbook Native , is there is any Facebook sdk for native platform, or Any work around.., i have searched but get nothing.., Also is Android facebook Sdk will work through Android RunTime on playbook or Not. ...

Posts: 10
Registered: ‎07-28-2010
My Device: All
My Carrier: Rogers

Re: PlayBook facebook SDK



Currently you could use the libcurl library that comes with our NDK - for the RESTful Facebook APIs. You can find many examples on the web of how to use it with RESTful web services. 


I haven't tried it myself but at a glance the Android Runtime should work with an app that uses the facebook Android SDK.

Posts: 79
Registered: ‎09-22-2010
My Device: 9700

Re: PlayBook facebook SDK

Posts: 133
Registered: ‎03-28-2011
My Device: BlackBerry 9900 & PlayBook
My Carrier: Bell

Re: PlayBook facebook SDK

The current problem is that you need to authenticate your app with Facebook to allow access to the user's profile. This requires an interactive web browser element, which means instantiating some sort of web browser viewer. As far as I'm aware, this doesn't exist in the Native SDK currently. It does in the WebWorks and Adobe AIR SDKs.

Founder of Pulsecode Inc. and taab
Authomator - Two-factor authentication codes on BlackBerry 10 - http://www.xitijpatel.com/ - Follow @xitijpatel
Is there a helpful or useful post in this thread? Click the thumbs up on it so that other people can find it more easily!
Posts: 12
Registered: ‎07-05-2012
My Device: Playbook
My Carrier: nonce

Re: PlayBook facebook SDK

Has anyone had any success implementing facebook with the Native SDK ?


Reading on the different Auth methods for facebook : https://developers.facebook.com/docs/authentication/

from this list on the page :

Authentication in native Android apps
Authentication in native iOS apps
Authentication within a Page Tab on www.facebook.com
Authentication within a Canvas Page on apps.facebook.com
Authentication for Websites & Mobile Web apps using Javascript (client-side flow)
Authentication for Websites & Mobile Web apps using a Server (server-side flow)
Authentication for devices without access to a browser

The last one seems to be our case, and if you click it ( https://developers.facebook.com/docs/authentication/devices/ )

There's a notice at the top of the page stating that they are allowing this with just certain partners.



2 Questions :


1) Is it possible to do java code (android facebook sdk) within a Native SDK project in Momentics ?

2) Is there any other way at all to make this work since using the REST api as suggested by the Blackberry advisor seems like it is problematic at the authentication phase ?

Posts: 368
Registered: ‎06-30-2012
My Device: Playbook, Z10LE, DevAlpha C
My Carrier: Telenor, Mobitel

Re: PlayBook facebook SDK

Fb uses OAuth 2.0 authentification.

You can check google APi and search for Oauth playground, they have very good tool for testing. Workflow in every Oauth 2.0 authentification is same., so what should work on google API, should on FB too, just change the urls. There is some native C++ lib which implements Oauth 1.0 authentification, and i managed to use it in native app for Playbook on 2.0.1 NDK.. Source of this lib you can find on http://oauth.googlecode.com/svn/code/c/liboauth/ 

I successfully compiled it and use it for Oauth 1.0 (just need to open external browser for user to login to and from there to paste token inside your app). I know it is not elegant way, but it seems to be only one, or hard way would be to make some "thin client" hardcoded for Fb only and in it to implement user login to FB. That lib above could be used for Oauth 2.0 probably with minor changes (hashing, encoding, etc is same on 1.0 and 2.0).

Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10
My Carrier: Verizon

Re: PlayBook facebook SDK

You would think/hope that the most popular social services (FaceBook, Twitter, etc), that the user can create a single login account under the device settings, would have a universal API for 3rd party developers. No need to re-invent the wheel each time (logins, etc).