如何创建“共享” Facebook 应用程序中 iframe 中的弹出窗口
我目前有以下方法,它创建一个“共享网址”,本质上是插入到应用程序内的 onclick="" 中的代码。
问题是,现在我们不能再拥有 Facebook FBML 应用程序,只能拥有 iframe - 我现在需要包含一个库才能使其工作吗?或者我应该更改代码,我已经用谷歌搜索过,但答案普遍没有结论性或回溯以强制其工作。
public function getShareUrl($title, $url, $caption, $description, $imageSrc, $shareButtonText = 'Share your thoughts!')
{
$url .= "var attachment = {
'name':'$title',
'href':'$url',
'caption':'$caption',
'description':'".$description."',
'media':[{
'type':'image',
'src':'$imageSrc',
'href':'$url'
}]
};
var actionLinks = [{
'text':'Join the app now',
'href':'$url'
}];
Facebook.streamPublish('', attachment, actionLinks, null, '$shareButtonText');
return false;";
return $url;
}
谢谢大家! :)
I currently have the following method which creates a "share url" essentially the code to insert into an onclick="" within the app.
The problem is that now we can no longer have Facebook FBML applications, only iframe - is there a library I now need to include to make this work? Or should I be changing the code, I have Googled but answers are widely inconclusive or backhacks to force it to work.
public function getShareUrl($title, $url, $caption, $description, $imageSrc, $shareButtonText = 'Share your thoughts!')
{
$url .= "var attachment = {
'name':'$title',
'href':'$url',
'caption':'$caption',
'description':'".$description."',
'media':[{
'type':'image',
'src':'$imageSrc',
'href':'$url'
}]
};
var actionLinks = [{
'text':'Join the app now',
'href':'$url'
}];
Facebook.streamPublish('', attachment, actionLinks, null, '$shareButtonText');
return false;";
return $url;
}
Thanks all! :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
要使共享弹出窗口出现在您的 Facebook 应用程序中,您必须使用 Javascript SDK,
您可以执行以下操作:
To make a share popup appear from within your facebook app, you have to use the Javascript SDK
you can do this: