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

你说的曾经没有我的故事 提交于 2019-11-27 08:11:36

问题


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?


回答1:


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.




回答2:


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);

}


来源:https://stackoverflow.com/questions/11384152/how-to-avoid-the-duplicate-status-message-error-in-using-facebook-sdk-in-ios

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!