Key hash for Android-Facebook app

后端 未结 30 3151
误落风尘
误落风尘 2020-11-22 01:17

I\'m working on an Android app, in which I want to integrate a Facebook posting feature. I downloaded the Facebook-Android SDK, and I got the readme.md (text file) in there,

30条回答
  •  没有蜡笔的小新
    2020-11-22 01:48

    The instructions currently in Facebook's Android Tutorial do not work well under Windows. Their example shows how to pipe the keytool output to openssl but if you try this under Windows the output is not valid for some reason. I found that I had to use intermediary files to get it to work properly. Here are the steps that worked for me:

    Start by downloading openssl for Windows from Google.

    C:\Users\Me>keytool -exportcert -alias my_key -keystore my.keystore -storepass PASSWORD > mycert.bin
    
    C:\Users\Me>openssl sha1 -binary mycert.bin > sha1.bin
    
    C:\Users\Me>openssl base64 -in sha1.bin -out base64.txt
    

    After running these commands the valid hash is stored in the file base64.txt. Copy and paste this to your app settings on Facebook.

提交回复
热议问题