I use the FBML fb: comments plugin in the Facebook application (which, although it was described as a “legacy” on the Facebook developer site, seems to be the only way to get the Facebook comments integrated in the Canvas application correctly? I know if I am mistaken, it seems to open open the ocean is easier than navigating the documentation on Facebook). I also use the JavaScript SDK to subscribe to the comment.create event comment.create that I can keep track of who is commenting on my pages. Easy enough, and this seems to work to some degree, but so far I have the following code:
FB.Event.subscribe('comment.create', function(response) { console.log(response); });
This returns a good JSON object, including the following nugget:
commentID: "10150576473610309"
Fine! I have a comment id. So, now I go to the Facebook API to get a little more information about this comment (I want text, author, etc.), So I set out the following in PHP, because according to Facebook docs, everything on Facebook has a unique identifier, and simply by clicking on the Graph API with that identifier, you will get some sweet information.
file_get_contents('http://graph.facebook.com/10150576473610309');
Oh no! This returns false. This is strange. Therefore, I check the API for all comments related to a specific page, and this gives me a list of comments ... but the identifier of the one I just added is different, now it is in the format:
"id": "10150576473610309_20003210"
What is this extra character and number ?! Calling the graphical API with this comment gives me information about the comments! Where and how (and why?) Did this new identifier appear? (Of course, I tried the forum for Facebook developers, but it seems that my question coincides with the same question as similar results).