具体配置参考第三方后台配置—Android版《二、Facebook第三方登录后台配置》
1、使用下面的程序获取key Hashes
1 2 3 4 5 6 7 |
public static void showHashKey(Context context) { try { PackageInfo info = context.getPackageManager().getPackageInfo(“com.ghw.sdk”,PackageManager.GET_SIGNATURES); //Your package name here for (Signature signature : info.signatures) { MessageDigest md = MessageDigest.getInstance(“SHA”);md.update(signature.toByteArray());Log.i(“KeyHash:”, Base64.encodeToString(md.digest(), Base64.DEFAULT)); }} catch (NameNotFoundException e) { } catch(NoSuchAlgorithmException e) { } } |
com.ghw.sdk要换成游戏的包名。将获取的KeyHash拷贝到facebook后台。