Hi, so I’m working on an iOS app, and I need to tweet an animated gif. I’m using the 1.1 version of the REST API.
if (granted) {
NSArray *accounts = [accountStore accountsWithAccountType:twitterType];
NSURL *url = [NSURL URLWithString:@"https://api.twitter.com/1.1/statuses/update_with_media.json"];
NSDictionary *params = @{@"status" : status};
SLRequest *request = [SLRequest requestForServiceType:SLServiceTypeTwitter requestMethod:SLRequestMethodPOST URL:url parameters:params];
[request addMultipartData:image
withName:@"media[]"
type:@"image/gif"
filename:@"image.gif"];
[request setAccount:[accounts lastObject]];
[request performRequestWithHandler:requestHandler];
}
I give the image as a NSData like this :
NSData *gifData = [NSData dataWithContentsOfFile: [[NSBundle mainBundle] pathForResource: @“image” ofType: @“gif”]];
Do you have an idea of why my gif isn’t animated ?