How to avoid duplicate posting when posting to Facebook?

With the Graph API, I am posting a POSTing story for connecting / me / feed. I will return to success or error from Facebook. So far, so good. From time to time, the API takes a lot of time and the connection time ends. In this case, I don’t know for sure whether the request was completed (for example, the request never reached Facebook, or maybe it succeeded, and the result never returned to me). How do you deal with this situation?

Read more: I post a lot of posts on Facebook and Twitter, so the timeout situation happens often. With Twitter, the solution is easy. If the request is the first time, I will just try again. Twitter detects duplicates, so if the message was successfully posted the first time, then I will get a “re-status” error in the second request, and I know that I no longer need to retry.

But Facebook does not detect duplicates, so if I repeat the publication request, I risk having two copies of the publication published on the user's wall, which is not very pleasant. On the other hand, if I do not try again, I risk that the post will not be published at all. Thoughts?

+5
source share
1 answer

Facebook.

. API- Graph, . . SDK API?

API .

, , - channelUrl. . https://developers.facebook.com/docs/reference/javascript/

, , . Expires . , , . , .

-2

All Articles