Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gif shared through UIActivityViewController comes out as static image in (at least) fb, twitter, notes

I'm trying to share a gif from my (unity) app, through the standard iOS sharing screen, to a social network.

Because of this question I first wrap the path to the gif in an NSURL before sending it to the UIActivityViewController:

NSURL *nsGifURL = [NSURL fileURLWithPath:nsGifPath];
NSArray *itemsToShare = @[nsMessage, nsGifURL];

// find the unity window:
UIWindow *window = [UIApplication sharedApplication].keyWindow;
UIActivityViewController *share = [[UIActivityViewController alloc] initWithActivityItems:itemsToShare applicationActivities:nil];
[window.rootViewController presentViewController:share animated:YES completion:nil];

This all compiles and runs without errors, but when I reach the other app, the image is static and not a gif.

How do I make apps like fb accept and display a gif on the other end?

EDIT: the nsGifPath definitely has the .gif extension

like image 200
tenpn Avatar asked Apr 10 '18 16:04

tenpn


1 Answers

as this answer you have to consider separated ways for social networks

TWITTER : For share a GIF on twitter had to use twitter API and create a multipart request to achieve the goal and its working very well.

FACEBOOK : I did share some GIF on Facebook using FACEBOOKSHAREKIT , but i don't know why sometimes Gifs are animated, sometimes not.

INSTAGRAM : To share gif on Instagram had to convert GIFS to MP4 (or any other video formats accepted by Instagram) then save it into camera roll then share it , It is little twisted but its working very well.

WHATSAPP : It not supporting GIF at all.

To do all of this i couldn't use "UIActivityViewController" , so decided to create a custom share page. if anybody know something to add here , to help me and others please tell me (especially about Facebook). Thanks in advance

like image 86
Arash Etemad Avatar answered Oct 11 '22 08:10

Arash Etemad