我有下面的代码要分享到一个facebook墙,但它没有给任何用户拥有管理员权限的托管页面共享的选项(我尝试用我自己的帐户进行测试),有人能帮我吗?另外,如果可能的话,我希望在将来按照feed中设定的日期发布。
<script>
window.fbAsyncInit = function() {
FB.init({appId: '475259649152397',
channelUrl : '<?php get_theme_root();?>/inc/facebook-javascript-sdk/channel.php',
status: true,
cookie: true,
xfbml: true
});
};
function Login()
{
FB.login(function(response)
{
if (response.authResponse)
{
getUserInfo();
}
else
{
console.log('User cancelled login or did not fully authorize.');
}
},{scope: 'manage_pages'});
}
(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>
<script type="text/javascript">
jQuery(document).ready(function(){
jQuery('#share_button').click(function(e){
e.preventDefault();
FB.ui({
method: 'feed',
name: 'This is the content of the "name" field.',
link: ' http://example.com/',
picture: 'http://myface.gif',
caption: 'insightful thought provoking caption.',
description: 'interresting".',
message: ''
});
});
});
</script>它可以很好地共享到用户墙,但不能选择与托管页面共享。
提前谢谢!
发布于 2013-09-10 09:40:26
选项,以共享给用户具有管理权限的任何托管页。
简单地,将PAGE_ID给to参数。就像-
FB.ui({
method: 'feed',
name: 'This is the content of the "name" field.',
link: ' http://example.com/',
picture: 'http://myface.gif',
caption: 'insightful thought provoking caption.',
description: 'interresting".',
message: '',
to: MY_PAGE_ID
});我想在将来发邮件
您可以使用页面访问令牌,如果希望在以后的任何时候将页面发布到页面,则可以将页面访问令牌扩展到永不过期的。从服务器向Facebook扇页发送长期令牌的步骤是什么
要获得由您管理的页面,请查询-
/me/accounts?fields=id,name,您将得到一组您正在管理的页面。现场演示
https://stackoverflow.com/questions/18709357
复制相似问题