0

只是试图实现 facebook 与我的 android 应用程序的集成,但它向我显示了用于 facebook 登录的 Misconfig,我确信我的 hashkeys 我是从这篇文章生成的,我的 facebook 应用程序配置是这样的

它仍然给我那个错误:S

编辑:我的代码

    Request.executeMeRequestAsync(session,
                            new Request.GraphUserCallback() {

                                // callback after Graph API response with
                                // user object
                                @Override
                                public void onCompleted(GraphUser user,
                                        Response response) {
                                    if (user != null) {


                                        userPassword = user.getId();
                                        String email = user.getLink();
                                        email = email.replace(".", "");
                                        email = email
                                                .replace("http://", "");
                                        email = email.replace("https://",
                                                "");
                                        email = email.replace("/", "");
                                        email = email + "@anydomains.com";

                                        userMail = email;
                                        new Login(true).execute();

                                        // register with fb


                                    }
                                }
                            });
4

1 回答 1

0

我想,你可以试试这个:

尝试调试您的应用程序,在onSessionstateChange中查看Exception not null。如果您的签名不匹配,您将在 Exception 中收到您的应用程序的正确签名(您也可以在 logcat 中看到它),而不是将其传递到 FaceBook 开发控制台。

更新

以下代码对我有用:

@Override
protected void onSessionStateChange(SessionState state, Exception exception) 
{
    if (exception != null)
    {   
        Log.i(TAG, exception.toString());
    }
    if (state.isOpened()) 
    {
        Request request = Request.newMeRequest( this.getSession(),
                                    new Request.GraphUserCallback() 
        {
            @Override
            public void onCompleted(GraphUser user, Response response) 
            {

            }
        });
        Request.executeBatchAsync(request);
    }
}

如果您的 keyhash 不匹配,您将在LogCat中看到它

if (exception != null)
{   
    Log.i(TAG, exception.toString());
}
于 2013-03-10T06:57:25.997 回答