Facebook Android Generate Key Hash

后端 未结 21 2348
误落风尘
误落风尘 2020-11-22 04:11

Trying to create an android app with Facebook integration, I\'ve gotten to the part in the docs where you have to generate a key hash file, it specifies to run the following

21条回答
  •  梦如初夏
    2020-11-22 04:58

    Even though this thread is old, yet I would like to share my experience (recently started working with facebook), which seems to me straight:

    1. Download openssl from the link bellow: https://code.google.com/p/openssl-for-windows/downloads/list
    2. Unzip it to a local drive (e.g., C:\openssl)
    3. To get the Development key for facebook integration, use the following command from the command line in windows:

      keytool -exportcert -alias androiddebugkey -keystore %HOMEPATH%.android\debug.keystore | "C:\openssl\bin\openssl.exe" sha1 -binary | "C:\openssl\bin\openssl.exe" base64

    NOTE!: please replace the path for openssl.exe (in this example it is "C:\openssl\bin\openssl.exe") with your own installation path.

    1. It will prompt for password, e.g.,

    Enter keystore password: android

    Type android as password as shown above.

    Thats it! You will be given a 28 character long key. Cheers!

    Use the same procedure to get the Release key. Just replace the command with the following and use your release key alias.

    keytool -exportcert -alias YOUR_RELEASE_KEY_ALIAS -keystore YOUR_RELEASE_KEY_PATH | "PATH FOR openssl.exe" sha1 -binary | openssl base64

提交回复
热议问题