1

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

4

2 に答える 2

3

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/appname/game1.php
于 2011-02-01T08:40:10.293 に答える
1

わかりました、Hafizはこのコードを試してください。

FB.ui({
    メソッド:'stream.publish'、
    メッセージ:「こんにちは」、
    添付ファイル:{
      名前:タイトル、

      キャプション:「私は走っています!」、
      メディア:[{
        タイプ:'画像'、
        href:'http://www.yoursite.com/'、
        src:'http://www.yoursite.com/images/working.jpeg'
      }]
    }、
    action_links:[{
      テキスト:'パーセンテージを取得'、
      href:'http://www.yoursite/'
    }]、
    user_message_prompt:'パーセンテージを取得することについて友達に伝えてください:'
  });
于 2011-02-01T08:24:05.820 に答える