Hopefully you have downloaded Facebook SDK and played with some basic examples. [If not, please go through http://developers.facebook.com/docs/guides/mobile/ ]
Now to enable SSO for your android app, you need to download following libraries
- Open SSO [http://code.google.com/p/openssl-for-windows/downloads/list] and extract in c:\dev\
- Now locate you key tool under JavaSDK\bin folder [To simply your headache, you can add these both in your path, in case if you are not not adding in path , hereafter give complete path to executable.]
- For debug mode , first open a command prompt and executes following command
Enter keystore password: android
<For debug mode this is the password you have to use , for release mode , point key store to you actual key store and enter strong password>
- Now open developer.facebook.com and go to you app.
- Edit application open mobile section in setting.
- Under android enter this hash and save app. It will take few minutes to propagate changes on Facebook server.
- Once done go to command prompt and install your application.
- Hopefully your application is working now able to use Facebook SSO . In case, if it’s not, check which step you missed.
- But you wont be able to get access token back, for that you have to override onActivityResult method in calling activity as following.
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if(fb != null) fb.authorizeCallback(requestCode, resultCode, data);
}
[Here fb is Facebook instance, change it as per your Facebook Instance name]
Once you do above, you will be able to use Facebook Single sign on.
원본 :
http://www.zubha-labs.com/facebook-single-sign-on-for-android
댓글 없음:
댓글 쓰기