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

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

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

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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)
1
2
3
4
5
6
7
8
9
10
11
12
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) {
}

Powered by AppBlog.CN     浙ICP备14037229号

Copyright © 2012 - 2020 APP开发技术博客 All Rights Reserved.

访客数 : | 访问量 :