gpt4 book ai didi

ios - 通过 UIActivityViewController 共享的 Gif 在(至少)fb、twitter、notes 中显示为静态图像

转载 作者:可可西里 更新时间:2023-11-01 04:49:43 32 4
gpt4 key购买 nike

我正在尝试通过标准 iOS 共享屏幕将我的 (unity) 应用程序中的 gif 分享到社交网络。

因为this question在将它发送到 UIActivityViewController 之前,我首先将 gif 的路径包装在 NSURL 中:

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];

这一切都编译和运行没有错误,但是当我到达另一个应用程序时,图像是静态的而不是 gif。

如何让 fb 等应用在另一端接受并显示 gif?

编辑:nsGifPath 肯定有 .gif 扩展名

最佳答案

作为this回答你必须考虑社交网络的分离方式

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 - 通过 UIActivityViewController 共享的 Gif 在(至少)fb、twitter、notes 中显示为静态图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49758643/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com