We’re seeing what may be a bug in the Twitter share extension in version 7.7 of the Twitter app for iOS. We’ve reproduced this issue on an iPhone 7 running iOS 10.3.3 (14G60).
If we pass a UIImage in the items array when initializing the UIActivityViewController, the compose view doesn’t show the image thumbnail and fails to post the tweet. No error is presented in the UI. The completionWithItems handler is called with the completed flag set to true and a nil error. When we pass only a string in the items array, it works as expected. When we pass a string and an image, it fails.
Code snippets:
// This works as expected.
let text = "This is a test."
let vc = UIActivityViewController(activityItems: [text], applicationActivities: nil)
// This doesn’t work. No thumbnail in compose view, no tweet posted, no error presented or returned.
let image = UIImage(named: “foo”)
let vc = UIActivityViewController(activityItems: [image], applicationActivities: nil)
// This also doesn’t work. Same as above.
let text = "This is a test."
let image = UIImage(named: “foo”)
let vc = UIActivityViewController(activityItems: [text, image], applicationActivities: nil)
When the Twitter app is removed from the device, iOS appears to fall back on the system’s share extension, which works as expected for both text and images.