如何显示“通过[我的应用程序名称”]当点“赞”时应用程序内的按钮

发布于 2025-01-06 05:25:53 字数 1209 浏览 4 评论 0原文

我正在尝试在我的 Facebook 应用程序内提供“喜欢”按钮,允许用户“喜欢”动态内容以宣传该应用程序。

出于这个原因,当有人点赞并且帖子出现在他们的墙上时,我需要说“通过[我的应用程序名称]和帖子底部的应用程序图标。但是,使用我当前的方法,我看到的是发布完美包含外部 URL 的链接,但应用程序的名称不存在。

该应用程序通过从我的 Canvas Index.php 引用加载 index.php 来运行:

< 脚本。 src="https://connect.facebook.net/en_US/all.js#xfbml=1">

和 $(document).ready 执行此操作:

            FB.init({
                appId       :   '[my app id]',
                status      :   true,
                cookie      :   true,
                xfbml       :   true
            });

然后通过 Ajax 将内容页面加载到中间的空白 div 中 通过 Ajax 加载的页面

包含许多以下实例:

> $(document).ajaxComplete(),我做 FB.XFBML.parse();

链接到的动态页面具有以下标签:

    <meta property="og:title" content="my title" />
    <meta property="og:description" content="<?=$php_variable?>" />
    <meta property="og:type" content="website" />
    <meta property="og:url" content="[the url of this page]" />
    <meta property="og:site_name" content="site name" />
    <meta property="fb:app_id" content="[my app id]" />

有人看到我哪里出错了吗?很高兴 - 我现在只是斗鸡眼,可能错过了一些东西,

提前感谢您的帮助!

I am trying to provide "Like" buttons INSIDE my Facebook app that will allow users to "Like" dynamic content for the purpose of advertising the app.

For this reason, when someone Like's and the post appears on their wall, I need to to say "via [My App Name] and the app's icon at the bottom of the post. However, with my current method, I'm seeing the post perfectly including the link to the external URL, but the App's name is not present.

The app runs by loading index.php from my Canvas URL. Index.php references:

< script src="https://connect.facebook.net/en_US/all.js#xfbml=1">

and $(document).ready does this:

            FB.init({
                appId       :   '[my app id]',
                status      :   true,
                cookie      :   true,
                xfbml       :   true
            });

then loads the content pages via Ajax into a blank div in the middle of the page.

The page loaded via Ajax contains numerous instances of the following:

< fb:like data-layout="button_count" href="[the url of my dynamic content]">

Then in $(document).ajaxComplete(), I do FB.XFBML.parse();

The dynamic page being linked to has the following tags:

    <meta property="og:title" content="my title" />
    <meta property="og:description" content="<?=$php_variable?>" />
    <meta property="og:type" content="website" />
    <meta property="og:url" content="[the url of this page]" />
    <meta property="og:site_name" content="site name" />
    <meta property="fb:app_id" content="[my app id]" />

Anybody see where I'm going wrong? If I missed posting any critical info, I'll be happy to - I'm just cross-eyed at this point and might have missed something.

Thank you in advance for your help!

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

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

发布评论

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

评论(1

稀香 2025-01-13 05:25:53

“赞”按钮不会将“赞”归因于链接到您喜欢的 URL 的应用程序 - 没有“通过”链接 - 将应用程序添加到页面已完成,以便应用程序可以发布给喜欢该页面的用户,管理见解等

The Like button doesn't attribute the like to the app linked to the URL you're liking - there is no 'via' link - adding the app to the page is done so that the app can publish to users that like the page, manage the insights, etc

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