Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Creating release key for Facebook SDK 3.0 in Android

I have a strange problem. I am trying integrate Facebook to my app. The functionality part is working just fine but the problem is it works only when connected from my PC directly i.e if connected my phone to eclipse and send the app it is work fine. If I extract the apk and install it from my phone directly The app doesn't log me in, doesn't create session etc etc.

Can somebody let me know what is wrong here?

Update 1:

Created the key as recommended by SK9 by following official facebook developer website.

C:\Java\jdk1.7.0_10\bin>keytool -exportcert -alias myAppfull -key store myAppfull | C:\openssl-0.9.8k_X64\bin\openssl sha1 -binary | C:\openssl-0.9.8k_X64\bin\openssl base64 I get the password prompt. I enter password that I used for export in eclipse and it gave a code. I entered in developers page.

Where: myAppfull is alias name and keystore that I used when I export using eclipse.

still the same problem? Is there anything that I Am missing?

Thanks!

Update 2:

It worked! Thanks!! Might be useful for others. Check my answer below!

like image 725
TheDevMan Avatar asked Dec 15 '22 09:12

TheDevMan


1 Answers

Thanks to SK9 and Vizz. I did some more research and figured out how to fix this issue.

THIS IS USEFUL FOR PEOPLE WHO ARE USING ECLIPSE TO CREATE THE KEYSTORE FOR RELEASE.

1) Open command prompt and give the path of JDK Bin folder in my case (C:\Java\jdk1.7.0_10\bin).

2) Copy this code keytool -exportcert -alias "youraliasnamethatwasgivenwhileexportineclipse" -keystore yourkeystorethatsavedwhileexportineclipse > c:\openssl\bin\release.txt

3) Now you need to enter password, Password = "samepasswordthatyouenterwhilecreatingthekeystoreineclipse".

4) See in openssl Bin folder you will get a file with the name of release.txt

5) Now change directory to your open ssl folder in my case: C:\openssl-0.9.8k_X64\bin\

6) copy the following code and paste openssl sha1 -binary release.txt > release_sha.txt

7) you will get release_sha.txt in openssl bin folder

8) Again copy following code and paste openssl base64 -in release_sha.txt > release_base64.txt

9) you will get release_base64.txt in openssl bin folder

10) open release_base64.txt file - Bingo you have the hashkey - copy the key.

Paste this beside your debug key in the facebook developer website. It should start working!

like image 197
TheDevMan Avatar answered Jan 10 '23 12:01

TheDevMan