Yun
Yun

Reputation: 5463

How to avoid the "Duplicate status message" error in using Facebook SDK in iOS?

I want to post the several same messages onto my feed/wall in an iOS application.

From the 2nd try, I receive this error -

(#506) Duplicate status message.

How can I solve it?

Upvotes: 3

Views: 14399

Answers (2)

Vadim Fainshtein
Vadim Fainshtein

Reputation: 143

I check for the 506 code and don't show any error to the user in case it's a duplicate status error

if (error && [[[[[error.userInfo objectForKey:@"com.facebook.sdk:ParsedJSONResponseKey"] objectForKey:@"body"]objectForKey:@"error"]objectForKey:@"code"] intValue] !=506) {

 alertTitle = NSLocalizedString( @"SomethingWentWrongTitle", nil);

}

Upvotes: 1

Lix
Lix

Reputation: 47986

You can't.

That is Facebook's way to tell you to stop spamming.

Sorry if it sounds slightly mean - but posting the same message over and over and over again is spamming, and its not good. The error message you are getting describes the problem - you are posting the same status message. It is a special error message created specifically for this case.

Upvotes: 14

Related Questions