android facebook session未打开但成功检索访问令牌

时间:2013-06-25 11:44:29

标签: android facebook facebook-graph-api

我正在为任何应用程序尝试facebook登录验证。问题是回调url带回验证页面。它不会进入session.isopen()

这是我的代码

 Session.openActiveSession(FrontPage.this, true, new Session.StatusCallback() {

                    @Override
                    public void call(Session session, SessionState state, Exception exception) {
                        // TODO Auto-generated method stub
                        Log.i("level 1", "entered sucessfully");
                        if (session.isOpened()) {
                            Log.i("level 2", "enter sucessfully");
                        Request.executeMeRequestAsync(session, new Request.GraphUserCallback() {

                            @Override
                            public void onCompleted(GraphUser user, Response response) {
                                // TODO Auto-generated method stub

                                if(user!=null){

                                    Intent i=new Intent(FrontPage.this,MapList.class);
                                      startActivity(i);

                                }

                            }
                        });
                        }
                    }
                });

@Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        // TODO Auto-generated method stub
        super.onActivityResult(requestCode, resultCode, data);
        Session.getActiveSession().onActivityResult(FrontPage.this, requestCode, resultCode, data);
    }

这是成功检索访问令牌

06-25 11:38:44.222: D/FacebookSDK.WebDialog(1318): Redirect URL: fbconnect://success#access_token=CAAC9kBahxZCwBAEGuCYsPVCZCNx27CcFDwOCQSw0RmuONzFnXT6zjDWFlZBIhjZAUTrvr35BxbcQbWMKsvo26RG8P2IXuPUrSMpH2WvDMGEVfe1ltDEu2QK7ZCdhq8D2BooMigOwZCrTdoMUUQZCXiw&expires_in=5164065

我做了什么错,我找不到它..请任何人帮我解决这个问题

0 个答案:

没有答案