SLComposeViewController hides Twitter auth errors

Originator:matt
Number:rdar://15394622 Date Originated:11/5/2013
Status:Open Resolved:
Product:iOS SDK Product Version:6+7
Classification:Serious But Reproducible:Always
 
Summary:
SLComposeViewController has no error structure for reporting bad twitter credentials (HTTP 401 from Twitter), and does not provide useful information to the user when it fails.

I have multiple accounts in Settings > Twitter: one authenticated, the other not. Presumably because I have one account logged in, [SLComposeViewController isAvailableForServiceType: SLServiceTypeTwitter] returns YES.

If I then select the unauthorized account and try to tweet, I get a vague "connection to Twitter failed" message. The console, however, reports that a 401 auth error came back from Twitter.

There are two problems here:

1) The user isn't told how to fix the problem (Go to Settings > Twitter and re-enter user/pass)
2) The API does report or return errors

So neither the developer nor the user are receiving the information they need to improve the situation.

It's also unclear how this happens in the first place. Settings does not let you save a Twitter account without successfully authenticating, so it sounds like someone is resetting auth tokens after the fact. Whether this is iOS (device-side) or Twitter (server-side) is unclear, but it spans versions and devices. I have other devices that are working just fine with all accounts.

Verified on:

iPhone 5, iOS 6.1.4
iPhons 5s, iOS 7.0.2

Steps to Reproduce:
1. Add multiple accounts to Settings > Twitter
2. Break or expire credentials for one of the accounts (unclear how or why this can happen)
3. Try tweeting a photo from Photos / Camera with the broken account

Expected Results:
Expect the tweet to work, or to see actionable information on how to fix the auth problem.

Actual Results:
"The tweet cannot be sent because the connection to Twitter failed." (see attached pic)

Also attached device log output reporting the 401 auth failure from Twitter.

Version:
iPhone 5, iOS 6.1.4
iPhons 5s, iOS 7.0.2

Notes:
Savvy users will be able to experiment and figure out what's wrong, but this could be a lot better on both user and API fronts.

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!