Re: [問題] FB API 問題

看板AndroidDev作者 (瘋子)時間11年前 (2013/05/07 11:49), 編輯推噓1(100)
留言1則, 1人參與, 最新討論串2/2 (看更多)
※ 引述《sweet00914 (別理我)》之銘言: : 我在使用fb api時發生了同樣的問題- http://0rz.tw/fixQo : I am having problem with facebook that if I am using my app first time : then login from facebook app is successfully which is installed in device : and then i logged out from my app and try to login then the facebook error : is showing like this...anyone faced this problem? : ========================================================================= : error message: Invalid android_key parameter. : The key hash does not match any allowed key. : 接著我將錯誤訊息上的key ,加入在 facebook developer 中的APP 設定 > : Key Hashes : 一樣產生錯誤。 : 請問各位大大在使用fb api version 3.0 版本是否有出現類似情形呢? : 是否可提供解決之道呢?謝謝 我之前也遇到這樣,最後我用程式碼,在log秀出對應我開發key的 Key Hashes try { PackageInfo info = getPackageManager().getPackageInfo( "pageage.name", PackageManager.GET_SIGNATURES); for (Signature signature : info.signatures) { MessageDigest md = MessageDigest.getInstance("SHA"); md.update(signature.toByteArray()); Log.e("KeyHash:", Base64.encodeToString(md.digest(), Base64.DEFAULT)); } } catch (NameNotFoundException e) { } catch (NoSuchAlgorithmException e) { } //使用此段程式碼,找出真正的keyhash -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 111.243.97.60

05/07 13:20, , 1F
感謝~問題已解決。0.0
05/07 13:20, 1F
文章代碼(AID): #1HY7czLO (AndroidDev)
討論串 (同標題文章)
文章代碼(AID): #1HY7czLO (AndroidDev)