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

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

问题描述

我使用的是Facebook的Andr​​oid SDK中访问该用户的Facebook相册和实习获得的照片。 但是,当我做了<$c$c>"https://graph.facebook.com/"+wallAlbumID+"/photos?access_token="+facebook.getAccessToken()它返回空白数据。 {数据:[]}

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": [] }

我看了在计算器问题也的在图形API的照片的,我需要给 user_photos 在创建Facebook的对象权限。 我不知道该怎么办so.I看了很多论坛,并检查了特种作战部队,但无法找到解决办法。

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());
}

希望这有助于!

Hope this helps!

这篇关于在Android中如何添加user_photos权限来获取Facebook相册的照片?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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