Android+Facebook: where are API KEY and API SECRET used?
I am using FBConnect on Android, it seems that the only ID I need is the app id, which is a string of digits:
Facebook mFacebook = new Facebook(FacebookConstants.APP_ID);
But I also got API Key and API Secret when register my app, I wonder where are these used? Did I do something wrong? I looked at the sample code from FBConnect, there is also nowhere using api key and api secret.
Edit: Can someone clarify that, are there three keys/IDs: app id, app key and app secret? Below are code from FBConnect's sample project: public static final String 开发者_StackOverflow中文版APP_ID = "175729095772478";
My app's application key does not look like this, mine has non-digits in it. And I'm still confused, in Facebook's Doc, there is a command:
keytool -exportcert -alias androiddebugkey -keystore ~/.android/debug.keystore
| openssl sha1 -binary
| openssl base64
it gives me a string which I can use to register on Facebook, but how does it relate to the application key and secret? I tried FBConnect's sample(the simple one) and I did not do the keytool command, it works; But if I use my app's application key, it does not work.
That is all you need for the facebook sdk just the appid. The keystore that you register on the facebook site handles all of the authentication that the key/secret normally would.
精彩评论