设置 Facebook 发布流 URL

发布于 2024-10-14 23:48:07 字数 613 浏览 8 评论 0原文

我在 Facebook FBML 应用程序中使用 facebookpublishStream 方法,其他一些开发人员在我之前就已经使用过它。我正在使用它,像这样

Facebook.streamPublish('Publish Shirt Tale. <?php echo $canvasURL.'?req=tale-details&tale_id='.$tale_id?>', attachment);

但是共享图像下还有另一个网址,请参阅下图以获取更多信息 在此处输入图像描述

因此,如图所示,有一个圆形链接,因此它指向其他页面,而我希望它指向应用程序的第一页。它目前转到类似这样的页面: http://apps.facebook .com/apps/application.php?id=xxxxxxxxxxxxx

那么谁能告诉我在哪里可以指定该 URL?

提前致谢

I am using facebook publishStream method in Facebook FBML Application, some other developer worked on it before me. I am using it some thing like this

Facebook.streamPublish('Publish Shirt Tale. <?php echo $canvasURL.'?req=tale-details&tale_id='.$tale_id?>', attachment);

But there is another url that is under the shared image, see below image for more info
enter image description here

So as in image there is encircle link, so that points towards some other page while I want it to the first page of app. It currently goes to a page some thing like this: http://apps.facebook.com/apps/application.php?id=xxxxxxxxxxxxx

so can any one tell that where can I specify that URL?

Thanks in advance

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

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

发布评论

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

评论(2

我做我的改变 2024-10-21 23:48:07

由于 facebook 很快就会弃用所有 FBML 应用,我建议您看这里,并尝试以这种方式创建一个对话框。我可以为您提供我当前正在使用的脚本,其中您圈出的链接指向我的应用程序的主页。需要注意的是 - 我的应用程序是一个 Iframe 应用程序。

    <script type="text/javascript">
    FB.ui(
  {
    method: 'stream.publish',
    attachment: {
      name: 'name',
      caption: 'caption',
      source: 'picture.jpg',
      picture: 'picture.jpg',
      description: 'description',
      href: 'http://apps.facebook.com/appname'
    },
    action_links: [
      { text: 'name', href: 'http://apps.facebook.com/appname' }
    ]
  },
  function(response) {
    if (response && response.post_id) {
      alert('Post was published.');
    } else {
      alert('Post was not published.');
    }
  }
);
    </script>

但是,如果您希望将应用程序保留在 FBML 表单中,请尝试以下代码:

    <script type="text/javascript">
    FB.ui(
  {
    method: 'stream.publish',
    attachment: {
      name: 'name',
      caption: 'caption',
      source: 'picture.jpg',
      picture: 'picture.jpg',
      description: 'description',
      href: 'http://apps.facebook.com/appname/index.php'
    },
    action_links: [
      { text: 'name', href: 'http://apps.facebook.com/appname/index.php' }
    ]
  },
  function(response) {
    if (response && response.post_id) {
      alert('Post was published.');
    } else {
      alert('Post was not published.');
    }
  }
);
    </script>

您需要了解 Iframe 和 FBML 应用程序之间的区别:而 Iframe 应用程序使用户始终停留在同一页面,并且仅显示内容在 Iframe 发生变化时,FBML 应用程序实际上将用户从一个页面移动到另一个页面。因此,在 FBML 应用中指定链接时,使用 http://apps.facebook.com/appname/page 链接而不是 http://www 非常重要。 yoursite.com/page 链接。

示例链接:

  1. 您网站上的链接:http://www.yoursite.com/game1.php
  2. 在 FBML 应用程序中看起来像这样:http://apps.facebook.com /应用程序名称/game1.php

As per facebook is deprecating all FBML apps soon, I would advise you to look here, and try and create a dialog in this way. I can give you the script I'm currently using, where the link you circled directs to my app's home page. a note should be made- my app is an Iframe app.

    <script type="text/javascript">
    FB.ui(
  {
    method: 'stream.publish',
    attachment: {
      name: 'name',
      caption: 'caption',
      source: 'picture.jpg',
      picture: 'picture.jpg',
      description: 'description',
      href: 'http://apps.facebook.com/appname'
    },
    action_links: [
      { text: 'name', href: 'http://apps.facebook.com/appname' }
    ]
  },
  function(response) {
    if (response && response.post_id) {
      alert('Post was published.');
    } else {
      alert('Post was not published.');
    }
  }
);
    </script>

If you however you would like to keep your app in the FBML form, try this code:

    <script type="text/javascript">
    FB.ui(
  {
    method: 'stream.publish',
    attachment: {
      name: 'name',
      caption: 'caption',
      source: 'picture.jpg',
      picture: 'picture.jpg',
      description: 'description',
      href: 'http://apps.facebook.com/appname/index.php'
    },
    action_links: [
      { text: 'name', href: 'http://apps.facebook.com/appname/index.php' }
    ]
  },
  function(response) {
    if (response && response.post_id) {
      alert('Post was published.');
    } else {
      alert('Post was not published.');
    }
  }
);
    </script>

You need to understand the difference between Iframe and FBML apps: While Iframe apps make the user stay in the same page all the time, and only the content in the Iframe is changes, FBML application actually move the user from page to page. Because of this, when specifying links in FBML apps, it is important to use the http://apps.facebook.com/appname/page link instead of the http://www.yoursite.com/page link.

Example links:

  1. A link on your site: http://www.yoursite.com/game1.php
  2. Would look like this in an FBML app: http://apps.facebook.com/appname/game1.php
灯角 2024-10-21 23:48:07

好吧哈菲兹然后尝试这个代码。

FB.ui({
    method: 'stream.publish',
    message:'hello',
    attachment: {
      name: title,

      caption: "I'm running!",
      media: [{
        type: 'image',
        href: 'http://www.yoursite.com/',
        src: 'http://www.yoursite.com/images/working.jpeg'
      }]
    },
    action_links: [{
      text: 'Get your percentage',
      href: 'http://www.yoursite/'
    }],
    user_message_prompt: 'Tell your friends about Get your percentage:'
  });

ok Hafiz then try this code.

FB.ui({
    method: 'stream.publish',
    message:'hello',
    attachment: {
      name: title,

      caption: "I'm running!",
      media: [{
        type: 'image',
        href: 'http://www.yoursite.com/',
        src: 'http://www.yoursite.com/images/working.jpeg'
      }]
    },
    action_links: [{
      text: 'Get your percentage',
      href: 'http://www.yoursite/'
    }],
    user_message_prompt: 'Tell your friends about Get your percentage:'
  });
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文