简体   繁体   中英

FacebookSDK Request.newMeRequest onCompleted called on JELLYBEAN but not KITKAT or LOLLIPOP

This code results in the onCompleted method being called on Samsung JELLYBEAN but not on Motorola KITKAT or LG LOLLIPOP devices. The log returns: W/Facebook test(20699): Facebook session status changed - OPENED - Exception: null on all devices.

private class SessionStatusCallback implements Session.StatusCallback {
    @Override
    public void call(Session session, SessionState state, Exception exception) {
        String message = "Facebook session status changed - "
                + session.getState() + " - Exception: " + exception;                     
        Log.w("Facebook test", message);
        if (session.isOpened()) {
            Request.newMeRequest(session, new Request.GraphUserCallback() {
                @Override
                public void onCompleted(GraphUser user, Response response) {
                    Log.d("onCompleted",""); 
                }
            }).executeAsync();
        } 
    }
}

I have checked permissions and the hashes stored. This is my onActivityResult method:

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

UPDATE: I created a test project with identical code to the problem app. This project doesn't have the problem, which suggests it isn't a java issue. The manifests are the same with regards to Facebook. I have the correct app_id in each case. The settings of the apps on developers.facebook.com are the same except for package name, class name and key hash.

  • Go to developers.facebook.com
  • Select your app
  • Select Status and Review
  • Change "Do you want to make this app and all its live features available to the general public?" to NO (I waited about ten minutes at this point, which may not be necessary)
  • Then change the same setting back to YES

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM