質問

I want to implement like this:

There is a share button and it will post the feed on my wall as well on friends wall. The code for the share button is this:

  FB.ui({ method: 'feed',
  caption: 'I just want to share',
  picture: 'https://manachi.herokuapp.com/images/logo_large.jpg',
  name: 'Checkout my Friend Smash greatness!',
  link: 'https://manachi.herokuapp.com/'
}, fbCallback);

I simply wanted to redirect to my FB canvas game if anybody clicks on the Game's Feed Post. For example if a user plays Candy Crush game and after completing the game, the user shares it on his feed. If someone clicks on the shared post it will open the Candy Crush game inside the Facebook Canvas.

In my game there is no challenge,no score. I just want to achieve above mention Canvas game app share functionality.

役に立ちましたか?

解決

You may try the bellow code. Some times sequence may be important and implementing function(response) method directly instead of implementing fbCallback works for me.

FB.ui(
      {
       method: 'feed',
       name: 'ManachiApp',
       caption: 'I just want to share',
      description: ('I just want to share on fb wall'),
      link: 'https://apps.facebook.com/manachi/',
      picture: 'http://manachi.herokuapp.com/images/logo_large.jpg'
      },
      function(response) {
        if (response && response.post_id) {
          alert('Post was published.');
        } else {
          alert('Post was not published.');
        }
      }
    ); 
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top