Question

I am using SLComposeViewController to share on twitter, whenever I share the same message twice in succession twitter shows me a error dialog stating that, the message is duplicate , see image below

enter image description here

Their is no way to handle this message, I am not understanding when this message comes up, Now if I click OK, shown on the alertView it calls

- (void)applicationDidBecomeActive:(UIApplication *)application
{

}

But my main problem is , I am providing a password facility for user, and I have written the code to show password View in this function.So generally, the above function is called only when the user opens the app once again. But in this case as this function is called , my app is showing password View.

So how to handle this situation

Regards Ranjit.

Was it helpful?

Solution

The error message is an integral part of the SLComposeViewController and as far as I remember you can't control this.

The display of the error message and the associate process of sending the tweet is putting your app into a background state.

What would happen if you stored the tweet string when submitted, and then on each submission checked to see if the current tweet isEqualToString of the old tweet ? You could then abort the process if the tweets matched.

Another approach would be to save a BOOL to user defaults when the user starts the tweet process. When the app resumes and the delegate is called, read back in this saved BOOL. If the user was in the process of tweeting then don't show your password boxes.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top