iOS 共享 GIF(动画图像)不起作用

编程入门 行业动态 更新时间:2024-10-26 16:23:51
本文介绍了iOS 共享 GIF(动画图像)不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经快 2 天了,我一直在寻找解决问题的方法,但没有成功,我想使用 在 Facebook、Twitter、电子邮件、WhatsApp 上分享 GIF(动画图像)"UIActivityViewController".

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".

这是我的代码:

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 Gif 没有动画,它就像一个图像......我已经阅读了有关同一问题的所有 Stack-overflow 问题,例如 this或 this 或 这个 但它对我不起作用.

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 :为了在 twitter 上分享 GIF 必须使用 twitter API 并创建一个多部分请求来实现目标并且它工作得很好.

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:我确实使用 FACEBOOKSHAREKIT 在 Facebook 上分享了一些 GIF,但我不知道为什么有时 Gif 是动画的,有时不是.

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

INSTAGRAM:要在 Instagram 上分享 gif 必须将 GIFS 转换为 MP4(或 Instagram 接受的任何其他视频格式),然后将其保存到相机胶卷中然后分享,它有点扭曲,但它的工作原理很好.

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:它根本不支持 GIF.阅读更新

WHATSAPP : It not supporting GIF at all. READ THE UPDATE

为了完成所有这些,我无法使用 "UIActivityViewController" ,所以决定创建一个自定义共享页面.如果有人知道要在这里添加的内容,以帮助我和其他人,请告诉我(尤其是关于 Facebook).提前致谢

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

更新

WHATSAPP:感谢@AmmarShahid,正如他在评论中提到的,Whatsapp 现在支持 gif.

WHATSAPP : Thanks to @AmmarShahid, as he mentioned in comments, Whatsapp now supports gif.

这篇关于iOS 共享 GIF(动画图像)不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

更多推荐

[db:关键词]

本文发布于:2023-03-31 16:56:46,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/808757.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:不起作用   图像   动画   iOS   GIF

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!