问题描述
我正在使用Facebook的android sdk来访问用户的Facebook专辑,实习生获得照片。
但是当我做一个https://graph.facebook.com/+ wallAlbumID +/ photos?access_token =+ facebook.getAccessToken()
返回空白数据。 {data:[]}
I am using the facebook android sdk to access the user's facebook albums and intern get the photos.But when I do a "https://graph.facebook.com/"+wallAlbumID+"/photos?access_token="+facebook.getAccessToken()
it returns blank data. { "data": [] }
我读了以及我需要在创建Facebook对象时给出 user_photos
权限。
我不知道该怎么做。我读了很多论坛,也检查了SOF,但找不到解决方案。
I read in stackoverflow question and also in Graph API for Photo that I need to give user_photos
permission while creating the facebook object.I am not sure how to do so.I read a lot of forums and also checked on SOF but could not find the solution.
这是我如何创建Facebook对象
This is how I am creating the facebook object
facebook = new Facebook(APP_ID);
任何人都可以帮助我。
Can anyone please help me with this.
推荐答案
您需要创建一个您要访问的权限的 ArrayList
。例如,当我这样做时,声明变量。
You need to create an ArrayList
of permissions you want to access. For example, when I did it, when declaring variables.
private static final String[] PERMISSIONS = { "user_photos" };
然后,在实现用户登录区域时:
Then, when implementing the user login area:
if (!facebook.isSessionValid()) {
facebook.authorize(this, PERMISSIONS, new LoginDialogListener());
}
希望这有帮助!
这篇关于在Android中如何添加user_photos权限获取Facebook相册照片?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!