Domanda

Facebook URL mentioned below return empty data but there is album images in Facebook, i am using new Facebook SDK 3.5.2. anyone have suggestion please help me to come out of this issue. Thanks on advance

"https://graph.facebook.com/ID/albums?access_token=Token";

È stato utile?

Soluzione

I was having the same problem. Read this. Some users dont allow access to their albums and photos through apps. You will have to code accordingly.

            Session.NewPermissionsRequest np = new Session.NewPermissionsRequest(this, "friends_photos");
            Session.getActiveSession().requestNewReadPermissions(np);
            Request rq = new Request(Session.getActiveSession(), userID + "/albums", null, HttpMethod.GET, new Request.Callback() {

                @Override
            public void onCompleted(Response response) {

            }
            });
            rq.executeAsync();

        }

Here is what it should look like. just change userID to the user whose albums you want to retrieve with response being the data that is returned.

Altri suggerimenti

I got result by adding below this permissions but i need album list now i get only cover photo and profile picture.

 if(session != null && !session.isOpened()){
  OpenRequest openRequest = new OpenRequest(this).setCallback(statusCallback);
 if (openRequest != null) {
    openRequest.setDefaultAudience(SessionDefaultAudience.EVERYONE);
    openRequest.setPermissions(Arrays.asList("friends_hometown","user_photos","friends_photos"));
    openRequest.setLoginBehavior(SessionLoginBehavior.SSO_WITH_FALLBACK);
    session.openForRead(openRequest);
}
}
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top