Sharing an image from a file URL with UIActivityViewController

ios

#1

Hey

I am passing UIActivityViewController 2 objects: A NSURL and a String.

The NSURL is for an image stored locally.

If I present the controller without the Twitter app installed and just use the built in Twitter share extension, it successfully posts the Tweet.

However, if I install the Twitter app. The Twitter app will appear as an option. It will present the share sheet correctly (showing the text and image). No error will be shown when “Post” is tapped, but the Tweet is never sent.

When opening the Twitter app and viewing drafts, you can see the failed Tweets

Here is a video: http://up.red.to/y3mBslP1ca

Code:

let activityText = "#upshot"
let activityViewController = UIActivityViewController(activityItems: [unwrappedFilePathURL, activityText], applicationActivities: nil)
self.presentViewController(activityViewController, animated: true, completion: nil)

Thanks, Red