2

我开发了一个android应用程序,并成功地将facebook sdk集成到我的APP中。
我之前在 facebook sdk 附带的 HelloFacebookSample 应用程序上做了一些测试。
HelloFacebookSample 中的 UserGraph 实例中给出的应用程序 ID 在图形 api 中运行良好。
像这样https://graph.facebook.com/1531414210465350
或像这样https://www.facebook.com/1531414210465350
知道这1531414210465350user.getId();在 HelloFacebookSample 中获得的应用程序 ID
但是当我尝试将自己的应用程序 ID 放入图表或链接中,我收到错误:

{
   "error": {
      "message": "Unsupported get request. Please read the Graph API documentation at https://developers.facebook.com/docs/graph-api",
      "type": "GraphMethodException",
      "code": 100
   }
}

我遗漏了一些东西,但我不知道在哪里,如果您有任何建议,我将不胜感激
这是主要的活动代码:

public class getJID extends FragmentActivity {
    private static final String PERMISSION = "publish_actions";
    private LoginButton loginButton;
    private UiLifecycleHelper uiHelper;
    private Session.StatusCallback callback = new Session.StatusCallback() {
        @Override
        public void call(Session session, SessionState state,
                Exception exception) {
            onSessionStateChange(session, state, exception);
        }
    };

    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);
        Session.getActiveSession().onActivityResult(this, requestCode,
                resultCode, data);
    }

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.facebook_login);
        uiHelper = new UiLifecycleHelper(this, callback);
        uiHelper.onCreate(savedInstanceState);
        Session session = Session.getActiveSession();
        loginButton = (LoginButton) findViewById(R.id.connectWithFbButton);
        loginButton
                .setUserInfoChangedCallback(new LoginButton.UserInfoChangedCallback() {
                    @Override
                    public void onUserInfoFetched(GraphUser user) {
                        if (user != null) {
                            try {

                                System.out
                                        .println("this is from the user object "
                                                + user.getId());
                            } catch (Exception e) {
                                System.out.println(e.getMessage());
                            }
                        }

                    }
                });

    }

    private void onSessionStateChange(Session session, SessionState state,
            Exception exception) {
        if (state.isOpened()) {
            System.out.println("SESSION IS OPPENED");
        } else if (state.isClosed()) {
            System.out.println("SESSION IS CLOSED");
        }
    }
}

知道我将我的应用程序 ID 放在清单中并且一切正常,除了范围内的应用程序 ID 未与记录的配置文件映射。

4

0 回答 0