设置Facebook发布流URL

设置Facebook发布流URL,facebook,facebook-wall,Facebook,Facebook Wall,我在FacebookFBML应用程序中使用FacebookPublishStream方法,其他一些开发人员在我之前就做过。我用的是这样的东西 Facebook.streamPublish('Publish Shirt Tale. <?php echo $canvasURL.'?req=tale-details&tale_id='.$tale_id?>', attachment); Facebook.streamPublish('Publish Shirt Tale',附件)

我在FacebookFBML应用程序中使用FacebookPublishStream方法,其他一些开发人员在我之前就做过。我用的是这样的东西

Facebook.streamPublish('Publish Shirt Tale. <?php echo $canvasURL.'?req=tale-details&tale_id='.$tale_id?>', attachment);
Facebook.streamPublish('Publish Shirt Tale',附件);
但在共享图像下还有另一个url,请参阅下面的图像以了解更多信息

就像在图片中一样,有一个环绕链接,指向其他页面,而我希望它指向应用程序的第一页。它当前会转到一个页面,如下所示:

那么有人能告诉我在哪里可以指定那个URL吗


提前感谢

好的,哈菲兹,然后试试这段代码

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:' }); FB.ui({ 方法:“stream.publish”, 留言:'你好', 附件:{ 姓名:职务,, 描述:“我在跑步!”, 媒体:[{ 键入:“图像”, href:'http://www.yoursite.com/', src:'http://www.yoursite.com/images/working.jpeg' }] }, 行动链接:[{ 文本:“获取您的百分比”, href:'http://www.yoursite/' }], 用户\消息\提示:“告诉您的朋友获取您的百分比:” });
好的,哈菲兹,然后试试这个代码

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:' }); FB.ui({ 方法:“stream.publish”, 留言:'你好', 附件:{ 姓名:职务,, 描述:“我在跑步!”, 媒体:[{ 键入:“图像”, href:'http://www.yoursite.com/', src:'http://www.yoursite.com/images/working.jpeg' }] }, 行动链接:[{ 文本:“获取您的百分比”, href:'http://www.yoursite/' }], 用户\消息\提示:“告诉您的朋友获取您的百分比:” }); 根据facebook的说法,我建议你这样做,并尝试以这种方式创建一个对话。我可以给你我当前使用的脚本,你圈出的链接指向我的应用程序主页。请注意-我的应用程序是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>

FB.ui(
{
方法:“stream.publish”,
附件:{
姓名:'姓名',
标题:"标题",,
资料来源:“picture.jpg”,
图片:“picture.jpg”,
description:'description',
href:'http://apps.facebook.com/appname'
},
行动链接:[
{text:'name',href:'http://apps.facebook.com/appname' }
]
},
功能(响应){
if(应答和应答后id){
警报(“发布帖子”);
}否则{
警报(“未发布帖子”);
}
}
);
如果您希望将应用程序保留在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>

FB.ui(
{
方法:“stream.publish”,
附件:{
姓名:'姓名',
标题:"标题",,
资料来源:“picture.jpg”,
图片:“picture.jpg”,
description:'description',
href:'http://apps.facebook.com/appname/index.php'
},
行动链接:[
{text:'name',href:'http://apps.facebook.com/appname/index.php' }
]
},
功能(响应){
if(应答和应答后id){
警报(“发布帖子”);
}否则{
警报(“未发布帖子”);
}
}
);
您需要了解Iframe应用程序和FBML应用程序之间的区别:虽然Iframe应用程序使用户始终停留在同一页面上,并且只有Iframe中的内容是变化的,但FBML应用程序实际上会将用户从一页移动到另一页。因此,在FBML应用程序中指定链接时,使用
http://apps.facebook.com/appname/page
链接而不是
http://www.yoursite.com/page
链接

示例链接:

  • 您网站上的链接:
    http://www.yoursite.com/game1.php
  • 在FBML应用程序中看起来像这样:
    http://apps.facebook.com/appname/game1.php
  • 根据facebook的说法,我建议你这样做,并尝试以这种方式创建一个对话。我可以给你我当前使用的脚本,你圈出的链接指向我的应用程序主页。请注意-我的应用程序是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>
    
    
    FB.ui(
    {
    方法:“stream.publish”,
    附件:{
    姓名:'姓名',
    标题:"标题",,
    资料来源:“picture.jpg”,
    图片:“picture.jpg”,
    description:'description',
    href:'http://apps.facebook.com/appname'
    },
    行动链接:[
    {text:'name',href:'http://apps.facebook.com/appname' }
    ]
    },
    功能(响应){
    if(应答和应答后id){
    警报(“发布帖子”);
    }否则{
    警报(“未发布帖子”);
    }
    }
    );
    
    如果您希望将应用程序保留在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>
    
    
    FB.ui(
    {
    方法:“stream.publish”,
    附件:{
    姓名:'姓名',
    标题:"标题",,
    资料来源:“picture.jpg”,
    图片:“picture.jpg”,
    description:'description',
    href:'http://apps.facebook.com/appname/index.php'
    },
    行动链接:[
    {text:'name',href:'http://apps.facebook.com/appname/index.php' }
    ]
    },
    功能(响应){
    if(应答和应答后id){
    警报(“发布帖子”);
    }否则{
    警报(“未发布帖子”);
    }
    }
    );
    
    您需要了解Iframe应用程序和FBML应用程序之间的区别:虽然Iframe应用程序使用户始终停留在同一页面上,并且只有Iframe中的内容是变化的,但FBML应用程序实际上会将用户从一页移动到另一页。因此,在FBML应用程序中指定链接时,使用
    http://apps.facebook.com/appname/page
    链接而不是
    http://www.yoursite.com/page
    链接

    示例链接:

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

  • 检查$canvasURL ad$tale_id的变量,确定其中的值是什么。它们可能指向任何其他应用程序。只要回显这些变量,看看它们的值就可以了