2

Android アプリケーションを開発し、Facebook SDK を APP に正常に統合しました。
Facebook SDKに付属のHelloFacebookSampleアプリケーションで、以前にいくつかのテストを行いました。
HelloFacebookSample の UserGraph インスタンスで指定されたアプリケーション ID は、グラフ API でうまく機能しました。
このようにhttps://graph.facebook.com/1531414210465350
またはこのようにhttps://www.facebook.com/1531414210465350 それがHelloFacebookSample で取得したアプリケーション IDである
ことを知っています が、自分のアプリケーション ID をグラフまたはリンクで、エラーが発生します:1531414210465350user.getId();

{
   "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