Search code examples
ruby-on-railsfacebookfeed

Is there a way to get the post_id of a feed post when a player clicks on one that loads your app?


Specifically what I am looking to do is to limit the number of times a player can click on a wallpost a receive a reward for doing so. I know that after a user posts to their wall there is a post_id that is the id associated with that feed post object. When a player clicks into my app is there any indication (via a post variable perhaps) as to which feed post object they clicked on? Or is it up to me to pass a unique variable over the link?


Solution

  • You should include your own unique URL parameter whenever you are creating the Post. You will see a ref parameter that is something like newsfeed or nf, but that refers to the location of the post, not the unique ID of it.

    Alternatively, and preferably, you should publish Open Graph Actions instead of just wall posts. With these you can add Action Links which will allow users who see an OG story from your app in feed to take an action directly from news feed. This is much simpler for them and will lead to greater click-thru and virality.