Bug in iOS Twitter app when sharing images as NSURL with UIActivityViewController


#1

Problem (iOS 9.2.1, Twitter app verison 6.48):
We have an issue when sharing an image from the Lightroom Mobile iOS app by passing the path to a local image file as an NSURL object to the UIActivityViewController (we do this to avoid memory issues on devices with less memory when sharing multiple images).

Without installed Twitter app the images gets correctly tweeted.

In case the Twitter app is installed, the image never gets tweeted but gets saved to the Twitter app’s “Draft” section with an “Tweet failed to send - Your tweet couldn’t be sent and has been saved as a draft” error. The draft does correctly show the tumb image but also the file path is shown in the text area of the tweet (see screenshots below, e.g. file:///private/var/…).

This obviously seems to be a bug in the Twitter app’s share extension.

Expected behaviour:
Even with Twitter app installed on the device the image should be tweeted without the URL as text.

Steps for reproduction:
The reproduction is pretty easy: install both apps - Twitter and Adobe Lightroom Mobile (https://itunes.apple.com/us/app/adobe-photoshop-lightroom/id878783582) on iPhone device. Try to share an image from LrM to Twitter. Try the same after deleting the Twitter app from the device.

Code used for sharing
@property (nonatomic, strong) UIActivityViewController *sharingViewController;
@property (nonatomic, strong) NSMutableArray *contentToShare;

if (!self.contentToShare) {
        self.contentToShare = [[NSMutableArray alloc] init];
}

[self.contentToShare addObject:[NSURL fileURLWithPath:@"file:///private/var/mobile/Containers/Data/Application/99CDCD99-5349-40B7-8301-DF4FE34D00D1/tmp/.managed/acae-2dc4-e705-4ab5.jpg" isDirectory:NO]];

self.sharingViewController = [[UIActivityViewController alloc] initWithActivityItems:self.contentToShare applicationActivities:nil];

Screenshots


#2

Any updates here ?
We are developing a feature in our app in which we are trying to tweet an Image. When the app is installed, in the preview of the tweet, the image is not shown. While if the app not installed, it shows the image thumbnail in the preview of the tweet. Also in the installed app case, the tweet doesn’t get posted as well. Posting some screenshots for both scenarios. Wanted to know if the problem described here is related to the issue pointed above and what are the updates on the issue.

Thanks