简体   繁体   中英

Facebook JS SDK - How to post custom story to timeline

I am trying to post a custom story to the user's timeline. When I try to post the story, it does not appear in the user's timeline, but it appears in the user's activity log (under the user's profile).

In order for the story to show in the timeline he has to select it in his activity log and choose "Show on timeline". Obviously this is not what I want. Is there any way I can make it show directly in the timeline?

I am using the following code:

var parent = this;
FB.api(
  'me/' + parent.facebook_app_namespace + ':score',
  'post',
  {
    newscore: "http://mydomain.com/open-graph/newscore?app_id=" + parent.facebook_app_id + "&game_id=" + parent.my_app_id + "&score=" + params.score + "&access_token=" + parent.facebook_app_access_token
  },
  function(response) {
    console.log(response);
  }
);

The code returns a object id, which indicates that the story has been posted successfully.

Thanks.

Most probably this is due to the fact that your app is in the development mode- in that case stories are not published on the wall but visible in the Activity Log.

You can switch your app to live mode in the App Settings-

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM