Android - Facebook KeyHash 設定
2014-09-12 18:21
309 查看
转自:http://www.dotblogs.com.tw/newmonkey48/archive/2014/04/17/144779.aspx
App要使用Facebook 分享時,設要在Facebook應用程式裡設定app 的key hash
但keyhash要怎麼取得呢?
可參考兩個網址
http://blog.changyy.org/2011/05/android-facebook-sdk.html http://blog.rx836.tw/blog/android-facebook-key-hashes/
需下載 openssl
http://blog.rx836.tw/blog/android-facebook-key-hashes/
下載後,解壓縮,如下,到bin資料下底下取得openssl.exe
C:\Users\Tom\Downloads\openssl-0.9.8h-1-bin\bin
放至Java目錄下,如下
C:\Program Files\Java\jdk1.6.0_23\bin
並從eclipse取得keystore放置位置
[Windpw] -> [Preferences] -> [Android] -> [Build] 的 Default debug keystore
我這邊取得的是
C:\Users\Tom\.android\debug.keystore
再來是使用Java bin底下的keytool,取得keyhash
打如下的指令
keytool -exportcert -alias androiddebugkey -keystore C:\Users\Tom\.android\debug.keystore | openssl sha1 -binary | openssl base64
會顯示以下,並輸入預設密碼android
輸入keystore 密碼:android
就會取得keyhash
再到facebook ->管理應用程式 ->自己的應用程式-> 設定 ,key hash 填入該keyhash即可。
debug.keystore的預設資料如下
Keystore name: "debug.keystore"
Keystore password: "android"
Key alias: "androiddebugkey"
Key password: "android"
CN: "CN=Android Debug,O=Android,C=US"
所以密碼才填android
注意:
打不到的alias及密碼,都會影響keyhash的產生結果,必須與當時的alias及密碼相同。
// mac平台
First open a terminal (open a command prompt in windows).
Navigate in the terminal to the directory where your Android debug.keystore is stored.
Mostly it will located under “/Users/user_name/.android/” (In Windows will be C:\Documents and Settings\.android).
Once you are in the “.android” directory, run the following command.
keytool -exportcert -alias androiddebugkey -keystore debug.keystore | openssl sha1 -binary | openssl base64
When it prompts you for a password, type android and hit Enter
Copy the value printed in the terminal that ends with an “=” and paste it in the Key Hash field in Facebook. Then click the Save Changes button.
App要使用Facebook 分享時,設要在Facebook應用程式裡設定app 的key hash
但keyhash要怎麼取得呢?
可參考兩個網址
http://blog.changyy.org/2011/05/android-facebook-sdk.html http://blog.rx836.tw/blog/android-facebook-key-hashes/
需下載 openssl
http://blog.rx836.tw/blog/android-facebook-key-hashes/
下載後,解壓縮,如下,到bin資料下底下取得openssl.exe
C:\Users\Tom\Downloads\openssl-0.9.8h-1-bin\bin
放至Java目錄下,如下
C:\Program Files\Java\jdk1.6.0_23\bin
並從eclipse取得keystore放置位置
[Windpw] -> [Preferences] -> [Android] -> [Build] 的 Default debug keystore
我這邊取得的是
C:\Users\Tom\.android\debug.keystore
再來是使用Java bin底下的keytool,取得keyhash
打如下的指令
keytool -exportcert -alias androiddebugkey -keystore C:\Users\Tom\.android\debug.keystore | openssl sha1 -binary | openssl base64
會顯示以下,並輸入預設密碼android
輸入keystore 密碼:android
就會取得keyhash
再到facebook ->管理應用程式 ->自己的應用程式-> 設定 ,key hash 填入該keyhash即可。
debug.keystore的預設資料如下
Keystore name: "debug.keystore"
Keystore password: "android"
Key alias: "androiddebugkey"
Key password: "android"
CN: "CN=Android Debug,O=Android,C=US"
所以密碼才填android
注意:
打不到的alias及密碼,都會影響keyhash的產生結果,必須與當時的alias及密碼相同。
// mac平台
First open a terminal (open a command prompt in windows).
Navigate in the terminal to the directory where your Android debug.keystore is stored.
Mostly it will located under “/Users/user_name/.android/” (In Windows will be C:\Documents and Settings\.android).
Once you are in the “.android” directory, run the following command.
keytool -exportcert -alias androiddebugkey -keystore debug.keystore | openssl sha1 -binary | openssl base64
When it prompts you for a password, type android and hit Enter
Copy the value printed in the terminal that ends with an “=” and paste it in the Key Hash field in Facebook. Then click the Save Changes button.
相关文章推荐
- Android Facebook SDK: Key hash does not match
- Android -- Facebook -- HashKey的生成
- Android faceBook KeyHash生成(生成发布密钥散列)
- Facebook KeyHash生成方法
- Key Hashes for Facebook Apps - Android application development in Windows
- facebook key hash生成
- 关于Android程序加入facebook的key的问题
- FaceBook Hashkey 匹配问题
- facebook hash key
- 申请Facebook app时hash key的生成
- FaceBook invalid key hash问题
- 获取Android key hash
- 如何产生facebook后台用到的key hashs
- 关于第三方facebook app Invalid key hash 问题
- 如何透过keytool获取android签名key的hash指纹
- Facebook KeyHash生成方法
- 如何申请个人Google API Key用于Android真机上发布安装
- Android之硬键盘字符映射------KeyCharacterMap
- [异常-开发环境-myeclipse-ubuntu-android2.2]keytool": java.io.IOException: error=13, 权限不够
- android - ANR keyDispatchingTimedOut