Reputation: 8796
I'm currently trying to use the Real-time updates from the Facebook API.
I successfully subscribed to them and received the subscription verification. When I do a GET request on
https://graph.facebook.com/[APP_ID]/subscriptions?access_token=[ACCESS_TOKEN]
I receive :
{"data":[{"object":"user","callback_url":"http:\/\/example.com:8454\/social\/facebook\/realtime\/facebookrequest","fields":["books","friends","music"],"active":true}]}
Then, I go to the page on my application where there is a "connect to Facebook" form. This form contains an hidden field :
<input id="scope" name="scope" type="hidden" value="publish_stream,user_photos,email,user_likes,friends_likes"/>
When I submit the form, I'm transfered to Facebook where I have to give the specified permissions to the application. After the confirmation, the application is able to access and display my email from Facebook, so the registration is sucessful!
Using the same user, I go back to Facebook and I add a band to my "music" section.
I wait, wait, wait, but the application never receives the POST request from Facebook to alert it something changed!
When I use a service like http://web-sniffer.net , I'm able to call the specified callback_url url with a POST request. So my server is listening and there is no firewall issues involved.
Any idea why it doesn't work? Am I missing something?
What could I do to debug this issue?
UPDATE :
I'm finally able to receive real-time updates, but only on "friends" changes! Adding or deleting a band still doesn't trigger any real-time update from Facebook... Weird.
Upvotes: 1
Views: 1753
Reputation: 8796
For some reason, registering for the "music" field was not correct. I tried registering on everything listed on the help page :
feed, friends, activities, interests, music, books, movies, television, likes, checkins, location, events
Then I added a new band to the Facebook profile and I did receive the real-time update! The update was listed as a "feed" changed_fields. So it seems registering for "feed" field modifications is the way to go...
Upvotes: 1