1

Okay so I read this post "http://facebook.stackoverflow.com/questions/10373897/deleting-a-previosly-posted-article-with-opengraph-or-check-if-said-article-has" but I'm using the news.reads action type.

So on the website when a user logs in with Facebook, and grant publishing permissions, every post they read gets pushed to their timeline. Everything is fine until they refresh/revisit the same article where facebook.php emits a Fatal error: Uncaught OAuthException: (#3501) User is already associated to the article object on a unique action type Read. Original Action ID: XXXXXXXXXXXXXXXX

I am fine that there is a bug with the built in news.reads OG and it being unique, but I was wondering if there was away to detect if a user has already read/viewed it.


Something like:

if (user is logged in [$user]) {
    if (user hasn't read article) {
        $facebook->api(/me......);
    } else if (user has read the article) {
        // Do Nothing
    }
} else { // If not logged in
    echo "login";
}

Hopefully that's possible, otherwise it would be a total bummer that I/user cannot view a page a second time without the facebook.php stopping the rest of the page being processed (its before the <html> tag).

Note: I prefer the PHP SDK, but am willing to use JS.

markb
  • 1,100
  • 1
  • 15
  • 40

1 Answers1

1

You should have stored the info that user foo has read article bar in your database anyway – since approval requirements for read action demand that you provide the user with an easy way to unpublish this action again.

CBroe
  • 91,630
  • 14
  • 92
  • 150
  • You don't happen to have some code, or example that I could understand? All the built-in OG is not clear to me, compared to the custom (cookie tutorial/coffee store tutorial/etc.). Even documentation that would let me know about *foo* – markb Jun 15 '12 at 12:11