Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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 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.

like image 934
hzxu Avatar asked Jun 15 '11 03:06

hzxu


People also ask

How do I find my API secret key?

To obtain a new API Key and API Secret, log in to your SendSafely account and go to the Edit Profile page. From there you should see an API Access Keys section that allows you to manage your API Keys.

How do I get an app Secret Facebook API?

Now expand the Setting menu and select Basic. Here you can find the App ID and App Secret. Then click on the “Show” button in the “App Secret” text box. You can copy the “App Id” and “App Secret” which you can use for your Facebook API calls.


1 Answers

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.

like image 132
Nathan Schwermann Avatar answered Oct 19 '22 23:10

Nathan Schwermann