通过 Javascript SDK 渲染 Facebook 好友的 FBML 替代方案

发布于 2024-12-25 10:33:52 字数 1619 浏览 5 评论 0原文

以下是我们从上周一开始面临的 Facebook API 的一些问题。 我们使用 FBML(Facebook 标记语言)向 Facebook 好友发送邀请(从我们的应用程序登录 Facebook 没有问题。),该语言正处于 Facebook 弃用阶段。 2012 年 1 月 1 日:平台将不再支持 FBML。 2012 年 6 月 1 日:FBML 应用程序将不再工作。所有 FBML 端点均被删除。您可以在这里找到更多信息:

developers.facebook.com/docs/reference/fbml/

function renderInviteFriends(contDiv) {
var htmlfb = "<span class='frnd-heading'>Facebook friends who are not yet using fipeo</span> <br /><br />";
htmlfb += "<fb:serverFbml width=\"" + width_of_invitation_div + "\"><script type=\"text/fbml\"><fb:fbml><fb:request-form action=" + window.location + " method='REQUEST' invite=true type='" + type_of_fb_request_form + "' ";
htmlfb += " content='<fb:req-choice url=\"" + baseUrl + "\" label=\"Accept\" />" + content_of_fb_request_form + "'>";
if (exclude_ids.length > 0)
    htmlfb += " <fb:multi-friend-selector cols=" + column_count_fb_multi_friend_selector + " exclude_ids=\"" + exclude_ids + "\" actiontext=\"" + actiontext_fb_multi_friend_selector + "\"/>";
else
    htmlfb += " <fb:multi-friend-selector cols=" + column_count_fb_multi_friend_selector + " actiontext=\"" + actiontext_fb_multi_friend_selector + "\"/>";
htmlfb += " </fb:request-form></fb:fbml></script></fb:serverFbml>";
document.getElementById(contDiv).innerHTML = htmlfb;
FB.XFBML.parse(document.getElementById(contDiv));
}

现在 FBML 的替代品是 FBJS。 如果有人已经对这些变化进行了研发并克服了这个问题,请与我们分享。请记住,我们使用 Javascript SDK 来实现 facebook API。

Here is some trouble with Facebook API we are facing from last monday.
We use FBML(Facebook markup language) for sending invitation to facebook friends(There is no problem in login to facebook from our app.) which is in phase of deprecation by Facebook.
On Jan 1, 2012: FBML will no longer be supported on Platform. June 1, 2012: FBML apps will no longer work. All FBML endpoints are removed. You can find more here:

developers.facebook.com/docs/reference/fbml/

function renderInviteFriends(contDiv) {
var htmlfb = "<span class='frnd-heading'>Facebook friends who are not yet using fipeo</span> <br /><br />";
htmlfb += "<fb:serverFbml width=\"" + width_of_invitation_div + "\"><script type=\"text/fbml\"><fb:fbml><fb:request-form action=" + window.location + " method='REQUEST' invite=true type='" + type_of_fb_request_form + "' ";
htmlfb += " content='<fb:req-choice url=\"" + baseUrl + "\" label=\"Accept\" />" + content_of_fb_request_form + "'>";
if (exclude_ids.length > 0)
    htmlfb += " <fb:multi-friend-selector cols=" + column_count_fb_multi_friend_selector + " exclude_ids=\"" + exclude_ids + "\" actiontext=\"" + actiontext_fb_multi_friend_selector + "\"/>";
else
    htmlfb += " <fb:multi-friend-selector cols=" + column_count_fb_multi_friend_selector + " actiontext=\"" + actiontext_fb_multi_friend_selector + "\"/>";
htmlfb += " </fb:request-form></fb:fbml></script></fb:serverFbml>";
document.getElementById(contDiv).innerHTML = htmlfb;
FB.XFBML.parse(document.getElementById(contDiv));
}

Now the alternative of FBML is FBJS.
If someone already done R&D on these changes and overcome from this problem please share with us. Please remember we use Javascript SDK for facebook API.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

土豪我们做朋友吧 2025-01-01 10:33:52

您应该将 请求对话框FB.ui 邀请用户使用 JavaScript SDK

顺便说一句,FBJS 将与 FBML 同时弃用

You should use Requests Dialog with FB.ui to invite users with JavaScript SDK

BTW, FBJS will be deprecated same time as FBML

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文