9

My app uses an SLComposeViewController to post to Twitter. This worked for a few months and then suddenly stopped about a week ago. The Twitter share view allows me to press "Post," and the following code still gets to the "..." line:

    twitterComposeViewController.completionHandler =
^(SLComposeViewControllerResult result){
        if (result == SLComposeViewControllerResultDone){
            ...
        }
    };

and dismisses the Twitter share view, but the tweet fails. I get a alert view that says,

Cannot Send Tweet

The tweet "[my tweet text]" cannot be sent because the connection to Twitter failed.

A moment later, the console logs,

plugin com.apple.share.Twitter.post invalidated

I have looked at some similar questions on SO, but none has an applicable answer (my tweet is not over the character limit; I am properly logged in; etc.). I have checked my settings at apps.twitter.com, and I don't see anything unusual.. my consumer key and secret have not changed...

Anyone know how to get more information about the error, or what I should check? Thank you.

mylogon
  • 2,772
  • 2
  • 28
  • 42
Benoît Freslon
  • 2,021
  • 4
  • 26
  • 35

2 Answers2

15

I found that strangely iOS has cleared out all of my Twitter account passwords. The accounts were still listed and the error said NOTHING about failing authorization, but that was the issue.

If you go into 'Settings' and 'Twitter', when you click on your account it will say 'user name or password is incorrect'. Fix the info and you will be all set.

Terrible error message, no idea how the average user would think to check that.

MobileVet
  • 2,958
  • 2
  • 26
  • 42
8

This problem occurs if you are trying to post same tweet more than once. You need to post different tweet every time.

Sumner Evans
  • 8,951
  • 5
  • 30
  • 47
  • Thanks, this solved the problem but what if I want to just open Twitter so I could type any text there? First time it works, second time it doesn't because it is same, without any text. – Vaclav Elias Jun 28 '15 at 17:52
  • Twitter consider that tweet as a duplicate and discard it so we can not post same tweet until we delete it. – Abdul Rahman Khan Jul 16 '15 at 05:57