Facebook 图个人资料图片不可靠 [英] Facebook graph profile image unreliable

查看:24
本文介绍了Facebook 图个人资料图片不可靠的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在我的 Facebook 应用程序上显示评论提要,我正在加载一系列 Facebook 用户 ID 和相关评论,以显示用户个人资料图片,我使用以下代码段:

I am trying to display a comments feed on my Facebook application, I am loading in an array of Facebook user ids and an associated comment, to display the users profile picture, I am using the following snippet:

<?php echo '<img src="http://graph.facebook.com/'.$c->_user.'/picture'" />; ?>

这工作正常,并获取图像,但是,如果我刷新我的页面,我会得到一些缩略图,如果不是所有缩略图都不会加载,再次刷新它们将始终存在,这是非常一致的,当我刷新它们会出现,下次不会出现,以此类推.

This works fine, and gets the image, however, if I refresh my page, I get some if not all of the thumbnails will not be loaded, refresh again and they'll always be there, it's pretty consistent that when I refresh they'll appear, next time they won't and so on.

我应该以不同的方式处理这个问题吗?我知道在浏览器中图形 API 重定向到实际图像,所以也许这就是导致我的浏览器有时不显示它们的原因,比如加载图像花费的时间太长?

Should I be dealing with this differently ? I know that in the browser the graph API redirects to the actual image, so maybe this is what's causing my browser to sometimes not display them, say if, it took too long to load the image ?

推荐答案

问题可能出在 创世 φ 说 说,这只是 Facebook 端的一个临时问题.但要补充他的建议,您可以尝试从 https: 提供图像.或者,您可以从 user FQL 表.

The issue is probably what genesis φ says says, just a temporary issue on Facebook's end. But to add on to his suggestions, you might try serving the image from https:. Alternatively, you can get the full, redirect-less picture URL from the user FQL table.

这篇关于Facebook 图个人资料图片不可靠的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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