iOS native share to Twitter converts shared animated GIFs to JPEG

ios
animatedgif

#1

Hi! It used to be possible to share animated GIFs from other apps to the Twitter app, but after a change late last year (somewhere between mid-October and early December), the animated GIFs shared are now converted to JPEG and posted to /api.twitter.com/1.1/statuses/update_with_media.json with content-type application/octet-stream. To be fair, the old behavior was a bit weird (it posted the GIF binary to the same endpoint, but with an incorrect content type of image/jpeg), but at least the result was that the GIF was tweeted correctly and did auto-play in the feed.

Here’s a snippet demonstrating the issue:

- (void)viewDidAppear:(BOOL)animated {

 NSString *path =
     [[NSBundle mainBundle] pathForResource:@"game" ofType:@"gif"];

 NSData *gifData = [NSData dataWithContentsOfFile:path];

 NSArray *objectsToShare = @[ gifData ];

 UIActivityViewController *activityVC =
     [[UIActivityViewController alloc] initWithActivityItems:objectsToShare
                                       applicationActivities:nil];

 [self presentViewController:activityVC animated:YES completion:nil];
}

Here’s a sample Tweet that used the old app.
Here’s a sample from the new one.

As you can tell, the animation is lost in the new one due to the conversion to JPEG.


#2

no solution?


#3

bump