集成Facebook错误:该密钥散列不匹配任何已存储的密钥散列

Android集成Facebook登录或分享时,需要设置发布密钥散列

参考:https://developers.facebook.com/docs/facebook-login/android

E/fb4a.GraphServiceQueryExecutor: query error
    X.60E: [code] 1349195 [message]: 该密钥散列不匹配任何已存储的密钥散列。请前往 https://developers.facebook.com/docs/facebook-login/android 了解更多信息。 [extra]: 
        at X.1aA.onError(:268275)
        at com.facebook.common.jniexecutors.NativeRunnable.run(Native Method)
        at com.facebook.common.jniexecutors.PooledNativeRunnable.run(:73542)
        at X.0gj.execute(:61285)
        at com.facebook.common.jniexecutors.NativeRunnable.run(Native Method)
        at com.facebook.common.jniexecutors.PooledNativeRunnable.run(:73542)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:457)
        at X.1kv.run(:117294)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:457)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:301)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
        at X.1l8.run(:117313)
        at java.lang.Thread.run(Thread.java:784)
try {
    PackageInfo info = getPackageManager().getPackageInfo(
            "cn.appblog.example",
            PackageManager.GET_SIGNATURES);
    for (Signature signature : info.signatures) {
        MessageDigest md = MessageDigest.getInstance("SHA");
        md.update(signature.toByteArray());
        Log.d("KeyHash:", Base64.encodeToString(md.digest(), Base64.DEFAULT));
    }
} catch (PackageManager.NameNotFoundException e) {
} catch (NoSuchAlgorithmException e) {
}

版权声明:
作者:Joe.Ye
链接:https://www.appblog.cn/index.php/2023/03/18/android-integrate-facebook-error-the-key-hash-does-not-match-any-stored-key-hashes/
来源:APP全栈技术分享
文章版权归作者所有,未经允许请勿转载。

THE END
分享
二维码
打赏
海报
集成Facebook错误:该密钥散列不匹配任何已存储的密钥散列
Android集成Facebook登录或分享时,需要设置发布密钥散列 参考:https://developers.facebook.com/docs/facebook-login/android E/fb4a.GraphServiceQueryExe……
<<上一篇
下一篇>>
文章目录
关闭
目 录