remote_app_id不匹配存储的ID - 异常不匹配、异常、remote_app_id、ID

2023-09-12 06:42:57 作者:红尘事

我使用的是原生的Facebook登录和我得到的CLOSED_LOGIN_FAILED。

i am using the facebook native login and i get the CLOSED_LOGIN_FAILED .

以下是LogCat中我得到的DDMS,

The following is the LogCat i get in DDMS ,

    02-22 15:16:22.939: E/exception(4583):  is null
    02-22 15:16:22.939: E/session(4583):  is {Session state:OPENING, token:{AccessToken token:ACCESS_TOKEN_REMOVED permissions:[]}, appId:420081348034777}
    02-22 15:16:22.939: E/state(4583):  is OPENING
    02-22 15:16:51.749: E/exception(4583):  is com.facebook.FacebookOperationCanceledException: remote_app_id does not match stored id 
    02-22 15:16:51.749: E/session(4583):  is {Session state:CLOSED_LOGIN_FAILED, token:{AccessToken token:ACCESS_TOKEN_REMOVED permissions:[]}, appId:420081348034777}
    02-22 15:16:51.749: E/state(4583):  is CLOSED_LOGIN_FAILED
    02-22 15:16:51.749: E/if logged in is(4583):  true : false
    02-22 15:16:51.749: E/if logged in is(4583):  exception : com.facebook.FacebookOperationCanceledException: remote_app_id does not match stored id 
    02-22 15:16:51.749: E/if logged in(4583):  premissions : []

我用得到keyhash

i get the keyhash using

C:\Program Files\Java\jre6\bin>keytool -exportcert -alias androiddebugkey -keystore "c:\documents and settings\Droid 4\.android\debug.keystore" | C:\openssl-0.9.8g_win32\bin\openssl sha1 -binary | C:\openssl-0.9.8g_win32\bin\openssl base64

其中,C:\ Documents和Settings \的Droid 4 \ .android \ debug.keystore是我的密钥存储路径 和 C:\ OpenSSL的-0.9.8g_win32 \ BIN \ OpenSSL的是我OpenSSL的路径

where "c:\documents and settings\Droid 4\.android\debug.keystore" is my keystore path and C:\openssl-0.9.8g_win32\bin\openssl is my openssl path

这是我怎么拿到钥匙的使用它通过Eclipse和为我创建密钥库,

this is how i get the key for using it through eclipse and for the keystore i create ,

C:\Program Files\Java\jre6\bin>keytool -exportcert -alias mykeystorename -keystore "D:\Apps\mykeystorepath" | C:\openssl-0.9.8g_win32\bin\openssl sha1 -binary | C:\openssl-0.9.8g_win32\bin\openssl base64

这是我用得到我的keyhash,签字与我进行发布创建的kaystore命令。

this is the command i use for getting my keyhash , signing with the kaystore i created for publishing .

我不知道我错了,我经历了所有相关的线程都尝试过,我并没有成功。

i dont know where i am going wrong , i have tried through all the related threads and i was not successful .

在此先感谢。

推荐答案

使用这块code,因为是更可靠的,我试过OpenSSL的,但没有成功,很多版本。

Use this piece of code because is more reliable, i tried many versions of openssl but with no success.

  try {
        PackageInfo info = getPackageManager().getPackageInfo("your.package",
                PackageManager.GET_SIGNATURES);
        for (Signature signature : info.signatures) {
            MessageDigest md = MessageDigest.getInstance("SHA");
            md.update(signature.toByteArray());
            Log.d("YOURHASH KEY:",
                    Base64.encodeToString(md.digest(), Base64.DEFAULT));
        }
    } catch (NameNotFoundException e) {

    } catch (NoSuchAlgorithmException e) {

    }

粘贴的onCreate

paste it in onCreate

 
精彩推荐
图片推荐