如何使用id(图形API)显示Facebook照片的实际图像 [英] How to display actual images of facebook photos using only id (graph API)

查看:147
本文介绍了如何使用id(图形API)显示Facebook照片的实际图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

  FB.api(
/ me /照片,
function(response){
if(response&&!response.error){
console.log(response);
} else {
console.log(response.error);
alert(response.error);
}
}
);

唯一的信息我在数据对象是 created_time id 名称所以我不知道如何从这些数据中创建可显示的图像。



我尝试过这个答案尝试使用id来获取实际的照片网址,但它只是在那里给出相同的信息。



权限是否对您收到的数据有影响吗?由于我还在为此提交过程。我只是认为它会工作,但是在弹出的顶部给出权限警告。

解决方案

你必须明确指定您希望从v2.4开始接收哪些字段。例如

  / me / photos?fields = id,link,images 
/ pre>

请参阅






声明性字段

为了提高移动网络的性能,v2.4中的节点和边缘要求您明确请求您的GET请求所需的字段。例如,GET /v2.4/me/feed默认情况下不再包含喜欢和评论,但GET /v2.4/me/feed?fields=comments,likes将返回数据。有关详细信息,请参阅有关如何请求特定字段的文档。



I am using the facebook graph API to get photos.

        FB.api(
                "/me/photos",
                function (response) {
                    if (response && !response.error) {
                        console.log(response);
                    } else {
                        console.log(response.error);
                        alert(response.error);
                    }
                }
        );

The only information Im getting back for each photo in the data object is created_time, id, and name so Im not sure how to buid displayable images out of this data.

I have tried this answer to try use the id to get the actual photo url but it is only giving back the same information there.

Does the permissions have an affect on the data that you receive back? As I am still in the submission process for this. I just assumed it would work anyway but give a permissions warning at the top of the pop up.

解决方案

You have to explicitly specify which fields you want to receive starting with v2.4. For example

/me/photos?fields=id,link,images

See

Declarative Fields
To try to improve performance on mobile networks, Nodes and Edges in v2.4 requires that you explicitly request the field(s) you need for your GET requests. For example, GET /v2.4/me/feed no longer includes likes and comments by default, but GET /v2.4/me/feed?fields=comments,likes will return the data. For more details see the docs on how to request specific fields.

这篇关于如何使用id(图形API)显示Facebook照片的实际图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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