UIActivityViewController错误:无法确定URL是否由文件提供者管理 [英] UIActivityViewController Error: Failed to determine whether URL is managed by a file provider

查看:104
本文介绍了UIActivityViewController错误:无法确定URL是否由文件提供者管理的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的应用程序中录制了一个视频,并将其写入temp目录,以允许用户通过UIActivityViewController共享它.视频可以在应用程序中成功播放,并且可以通过UIActivityViewController成功地通过消息发送,共享到Facebook并保存到相机胶卷中.但是,当我尝试通过WhatsApp分享时,出现以下错误:

I record a video in my app and write it it to the temp directory to allow the user to share it through UIActivityViewController. The video can successfully be played back in-app, and through UIActivityViewController can successfully be sent through Messages, shared to Facebook, and saved to camera roll. But when I try to share through WhatsApp, I get the following error:

Failed to determine whether URL /private/var/mobile/Containers/Data/Application/E7F57458-A5F9-44CB-86FA-ACC4309C7473/tmp/65CB72B3-373E-42F2-8A80-9888E00C2268.mp4 (n) is managed by a file provider

我无法找到有关此错误的更多信息.有谁知道为什么会这样?

I have been unable to find much information on this error. Does anyone know why this may be occurring?

推荐答案

找到了解决方法:

我正在打开一个UIActivityViewController,其中包含视频URL和一个字符串作为activityItems.仅传递视频网址可解决WhatsApp无法识别视频的问题.无法传递文本很烦人,但至少现在有视频了.

I was opening a UIActivityViewController with the video url and a string as the activityItems. Passing just the video url fixed the issue of WhatsApp not recognizing the video. It's annoying to not be able to pass in the text, but at least the video is now there.

不起作用:

UIActivityViewController(activityItems: [url, "Check out my video!"], applicationActivities: nil)

可以工作:

UIActivityViewController(activityItems: [url], applicationActivities: nil)

这篇关于UIActivityViewController错误:无法确定URL是否由文件提供者管理的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆