TWTRComposer with out connecting accounts

ios

#1

We’ve switched from SLComposeViewController to TWTRComposer, to allow our users to tweet simple messages on iOS 11. But the SDK appears to prompt our users to “Connect your account” and says that we can “read tweets and see who you follow”. We don’t really care out that, in fact it seems like a large deterrent - we just want to start the twitter app with a simple pre composed message that the user can customize and tweet.

I’ve noticed that using a custom URI works, e.g., twitter://post?message=example%20message - but this does not seem to support custom images. Is there a way to get the classic functionality back or specify images with the custom URI appoach?


#2

In order to post a Tweet, you need a user context (i.e. logged in user), and that is why TWTRComposer wants to be connected to a Twitter account. Pre-iOS 11, this was achieved with the OS-level accounts where the user granted access in iOS. Post-iOS 11, this has to be done on an app-by-app basis. We recognise that the OAuth scopes are not very granular, but at the moment there are no plans to change this.

You’re free to use the iOS share sheet instead, or the custom URI you mentioned, but that doesn’t include adding an image.


#3

Do you have a link to the documentation pertaining to the URI scheme and acceptable parameters? We’ll explore this as a stopgap solution for the time being.


#4

There’s no documentation on that URI scheme as it is not a supported part of the Twitter developer platform. What I should have suggested as a supported alternative was to use our Web Intents, which will open the Twitter app if it is installed. At the moment I’m not aware of plans to fully document the internal URI scheme for the Twitter iOS app.


#5

Thanks for the suggestion. We’ve gone with the share sheet through UIActivityViewController instead. Looking forward to a more user friendly way of integrating a share-only feature for twitter!