Facebook缓存共享缩略图需要多长时间?我使用以下命令为我的页面添加了自定义缩略图:
<meta property="og:image" content="/path/to/my/image" />
Run Code Online (Sandbox Code Playgroud)
但是在页面上显示我之前的图像=>它被缓存在FB服务器上的某个地方.
任何想法如何刷新缓存或FB加载新图像需要多长时间?
在Facebook query language(FQL),您可以指定一个IN子句,如:
SELECT uid1, uid2 FROM friend WHERE uid1 IN (1000, 1001, 1002)
Run Code Online (Sandbox Code Playgroud)
有谁知道你可以传递的最大参数数量是IN多少?
我用这个代码
<fb:login-button autologoutlink="true" perms="user_likes" size="large"></fb:login-button>
Run Code Online (Sandbox Code Playgroud)
创建登录/注销fb按钮.一切正常,登录后,登录按钮成为退出按钮.但是,如果用户单击注销按钮,则不会刷新当前页面,因此只有在用户通过身份验证时才应显示的所有内容仍然存在,直到完成手动页面刷新.
如果我获得注销网址(Javascript SDK),则不会发生这种情况
$logoutUrl = $facebook->getLogoutUrl();
Run Code Online (Sandbox Code Playgroud)
然后自己实现一个注销按钮; 在这种情况下,传递适当的"next"参数(使用当前页面的url)并重新加载当前页面.
我仍然想使用第一个解决方案,是否可以使用"下一个"参数?
App Domains: localhost
Website with Facebook login: http://localhost/auth
Run Code Online (Sandbox Code Playgroud)
我转到http://localhost/auth/我的Chrome开发者控制台,我看到错误:Given URL is not allowed by the Application configuration.: One or more of the given URLs is not allowed by the App's settings. It must match the Website URL or Canvas URL, or the domain must be a subdomain of one of the App's domains.
我做一个view-source看到以下内容:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<div id="fb-root"></div>
<script>
// …Run Code Online (Sandbox Code Playgroud) 我们在使用我们的按钮工作时遇到了一些麻烦.它似乎在上周工作,但突然它停止工作.
基本上点击"赞"时,我们会收到错误消息:
您未能提供有效的管理员列表.您需要使用"fb:app_id"元标记或使用"fb:admins"元标记来指定管理员,以指定以逗号分隔的Facebook用户列表.
我们的<head>部分如下所示:
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:og="http://opengraphprotocol.org/schema/" xmlns:fb="http://www.facebook.com/2008/fbml" xml:lang="en" lang="en">
<head>
<meta property="fb:app_id" content="number"/>
<meta property="fb:admins" content="number"/>
<meta property="og:title" content="title"/>
<meta property="og:type" content="website"/>
<meta property="og:url" content="url with trailing slash"/>
<meta property="og:image" content="url to image"/>
<meta property="og:site_name" content="Site Name"/>
</head>
Run Code Online (Sandbox Code Playgroud) 我以异步方式加载FB API:
<div id="fb-root"></div>
<script>
window.fbAsyncInit = function() {
FB.init({appId: 'your app id', status: true, cookie: true,
xfbml: true});
};
(function() {
var e = document.createElement('script'); e.async = true;
e.src = document.location.protocol +
'//connect.facebook.net/en_US/all.js';
document.getElementById('fb-root').appendChild(e);
}());
</script>
Run Code Online (Sandbox Code Playgroud)
我如何知道它何时被初始化?FB.ensureInit()在API初始化之前,什么是阻止运行封闭代码的方法的替代品?
我的智慧结束了查询参数值应该是什么样子.因此,为了总结图API库中的多个查询,以下是执行它的代码方法,据我所知.
$param = array(
'method' => 'fql.multiquery',
'queries' => $multiQuery,
'callback' => '');
$queryresults = $facebook->api($param);
Run Code Online (Sandbox Code Playgroud)
在Facebook的新PHP SDK库中使用这种方法,有没有人使这个工作?如果是这样,你可以举例说明如何构建$multiQuery变量的完整值?
我已经花了几天时间来解决这个问题,而且我只找到了旧的PHP库的exmaples.
让我们FQL从昨天开始用一个简单的查询来获取用户朋友共享的所有链接,例如:
SELECT link_id, title, url, owner, created_time
FROM link
WHERE
created_time > strtotime('yesterday') AND
owner IN (
SELECT uid2 FROM friend WHERE uid1 = me()
)
LIMIT 100
Run Code Online (Sandbox Code Playgroud)
如果用户有50个朋友,这将完美执行.但如果用户有数百个朋友,Facebook往往会返回错误.
选项:
如何正确查询Facebook以确保成功?
笔记:
与超时相关的常见错误:
1.
Fatal error: Uncaught Exception: 1: An unknown error occurred thrown in /..../facebook/php-sdk/src/base_facebook.php on line 708
Run Code Online (Sandbox Code Playgroud)
第708行是一个异常错误:
// results are returned, errors are thrown
Run Code Online (Sandbox Code Playgroud)
if (is_array($result) && isset($result['error_code'])) { …Run Code Online (Sandbox Code Playgroud) 我正在关注本教程http://developers.facebook.com/docs/appsonfacebook/tutorial/ ,特别是这部分代码
$app_id = "YOUR_APP_ID";
$canvas_page = "YOUR_CANVAS_PAGE_URL";
$auth_url = "http://www.facebook.com/dialog/oauth?client_id="
. $app_id . "&redirect_uri=" . urlencode($canvas_page);
Run Code Online (Sandbox Code Playgroud)
当我输入$canvas_page的
$canvas_page = "http://www.facebook.com/PAGE_NAME/app_APP_ID/"
Run Code Online (Sandbox Code Playgroud)
我得到了 "Error occured. Try again Later"
如果我输入Canvas Page Url,它会正确显示画布页面,但我不希望这样.
我相信它上周正在运作,所以我不知道现在有什么问题.
我遇到了Facebook的问题OpenGraph以及DateTime我在我的页面上设置的属性.
标签看起来像这样:
<meta content="2013-06-10" property="app:departing_on" />
Run Code Online (Sandbox Code Playgroud)
标签DateTime在OpenGraph类型上正确设置.我用它来创造一个新的故事.当我模拟一个帖子时,它会改变时区以匹配我的(UTC-3),所以我得到2013年6月9日晚上9点.这是一个仅限日期的活动,所以我实际上没有时间展示,只是一个约会.
我可以强迫Facebook将其解析为约会吗?
facebook ×10
facebook-fql ×2
caching ×1
logout ×1
oauth ×1
oauth-2.0 ×1
opengraph ×1
share ×1
sharing ×1
thumbnails ×1