iOS共享GIF(动画图像)不工作 [英] iOS Share GIF (animated image) not Working
问题描述
这是我的代码:
NSURL * imagePath = [NSURL URLWithString:@http://sth.gif];
NSData * animatedGif = [NSData dataWithContentsOfURL:imagePath];
NSArray * sharingItems = [NSArray arrayWithObjects:animatedGif,stringToShare,nil];
UIActivityViewController * activityVC = [[UIActivityViewController alloc] initWithActivityItems:sharingItems applicationActivities:nil];
当我分享电子邮件的动画和它的工作完美,但在Twitter,Facebook,whatsApp Gifs不是动画和它像一个图像... 迄今为止,基于日期研究发现: p> TWITTER :要在Twitter上分享一个GIF,必须使用twitter API并创建一个多部分请求来实现目标,并且其工作非常好。 p> FACEBOOK :我在Facebook上分享了一些GIF,使用 INSTAGRAM :分享gif在Instagram上,必须将GIFS转换为MP4(或者Instagram接受的任何其他视频格式),然后将其保存到相机胶卷中,然后分享它,它的扭曲很小,但其工作非常好。 WHATSAPP :它不支持GIF。 为了做到这一切,我无法使用UIActivityViewController ,因此决定创建自定义共享页面。如果有人知道要添加的内容,请帮助我和他人告诉我(特别是关于Facebook)。 It's been almost 2 days that i'm looking to find a solution to my problem but i wasn't successful , i want to share GIF (animated image) on Facebook, Twitter, Email, WhatsApp , using "UIActivityViewController". This is my code : When i share in Email its animated and its working perfect , but in Twitter , Facebook , whatsApp Gifs are not animated and its like an image ...
I already read all Stack-overflow questions about the same problem Like this or this or this but its not working for me. So far base on days research found out that : 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 这篇关于iOS共享GIF(动画图像)不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
我已经阅读所有关于相同问题的堆栈溢出问题像这个或此或
FACEBOOKSHAREKIT ,但我不知道为什么有时GIF是动画的,有时不是。
提前感谢NSURL *imagePath = [NSURL URLWithString:@"http://sth.gif"];
NSData *animatedGif = [NSData dataWithContentsOfURL:imagePath];
NSArray *sharingItems = [NSArray arrayWithObjects: animatedGif,stringToShare, nil];
UIActivityViewController *activityVC = [[UIActivityViewController alloc] initWithActivityItems:sharingItems applicationActivities:nil];