Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Facebook Connect for BlackBerry

I'm looking for a solution similar to the iPhone Facebook Connect (https://github.com/facebook/facebook-ios-sdk) for the BlackBerry platform. Basically, I need my users to authenticate against Facebook from within a native BlackBerry application (so, not a Web based mobile application). Is there a library I could use, and if not, what will be the correct approach to achieve this?

Thanks in advance!

like image 938
Gadi Avatar asked Oct 22 '09 21:10

Gadi


2 Answers

Options for BlackBerry are:

  • Use Facebook Platform for Mobile
  • Use REST API approach provided by Eki Y. Baskoro
  • Try to port JavaFB from J2SE to J2ME
like image 133
Maksym Gontar Avatar answered Oct 16 '22 00:10

Maksym Gontar


I managed to go through Facebook Connect authentication within my BB app. After cracking my head for three days I realised that it is the URL that is the culprit!

Basically these are what you need (assuming you are developing for 4.5 platform):

  1. Using Browser Field, do a POST to http://m.facebook.com/login.php (the mobile version of Facebook) passing all the necessary arguments as per the Desktop application counterparts (one challenge is to get the signature generation correct).
  2. Once the User successfully grants access, capture the URL of the success screen. You will obtain your auth_token.
  3. Do a POST to the REST server to obtain the session key and secret given the auth_token you obtain.
  4. Save the returned session key and secret, persist it, and wholla! your app is up and running.

I am developing a custom LoginScreen and FacebookFacade object to incorporate the first three steps above, if anyone is ever interested to reuse my code. It'll be GPLed, I suppose ;)

like image 28
Saurabh Avatar answered Oct 16 '22 01:10

Saurabh