On 31st May Facebook had announced few changes in open graph approval process and also Updated Open Graph Publishing Guidelines in which some important parts were:
90-day update window
- Even if we’ve approved your custom action for reading an article or watching a video, you must migrate to using a built-in action, resubmit your app and get approved. Please review the requirements for working with read and watch actions.
- Built-in watch and read actions can only be published after someone engages with the content for 10 or more seconds. If a video is shorter than 10 seconds, the viewer must watch the entire video.
- Tagging people and places:
So according to guidelines above developers have to use built-in actions instead of custom read and watch actions and also to post action only when user engages with the content for 10 or more seconds, to meet these requirements I thought I should write an updated tutorial on it because in my earlier tutorial on How to publish actions on timeline we had used custom actions to post on users timeline.
So lets start the tutorial without wasting any time!
I am assuming you already know how to setup Facebook so i will only cover the open graph section.
1. First go to open graph section of your app and click on Create New Action Type as shown below
2. Now select built-in read action type as shown below
3. When you click on submit button you will now see objects and aggregations are automatically added as shown below
4. Now when you click on submit button you will see a message
You must publish at least one action to your Timeline using this action type. Review the documentation.
To publish built-in read action you can download package from here, now all you have to do is upload all the files to your server, after uploading open config.php file and replace dummy FACEBOOK_APP_ID and FACEBOOK_SECRET with your apps id, secret and also fbrdurl, now for fbrdurl if you have uploaded your files to http://yoursite.com/yourdirectory/ then the fbrdurl will be http://yoursite.com/yourdirectory/demo-page.php once you have done that you have finished, you can now check the demo page by visiting the http://yoursite.com/yourdirectory/demo-page.php.
Note: By using built-in read action type action will be posted only once for each url if action is already posted then you will see an error saying
(#3501) User is already associated to a article object on a unique action type Read. Original Action ID:
now you have to delete previously posted action if you want to use the same url for OG action posting.