在Android中如何添加user_photos权限获取Facebook相册照片? [英] In Android how to add user_photos permission to get the facebook album photos?

查看:133
本文介绍了在Android中如何添加user_photos权限获取Facebook相册照片?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用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": [] }

我读了在stackoverflow问题以及我需要在创建Facebook对象时给出 user_photos 权限。
我不知道该怎么做。我读了很多论坛,也检查了SOF,但找不到解决方案。

I read in stackoverflow question and also in Graph API for Photo that I need to give user_photospermission 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相册照片?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆