如何在UIActivityViewController中添加应用 [英] How to add app in UIActivityViewController

查看:219
本文介绍了如何在UIActivityViewController中添加应用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个应用程序,该用户可以将视频上传到我们的服务器.现在,我想在UIActivityViewController中添加我的应用程序,以便从图库用户选择视频并打开我的应用程序,这样它将直接从图库本身上传到我的服务器.

I am developing one app in that user can upload video to our server. Now I want to add my app in UIActivityViewController so from gallery user can select video and open my app so it will directly upload to my server from gallery itself.

如何将我的应用添加到UIActivityViewController?在此屏幕截图中,类似于Facebook,Vimeo和YouTube:

How can I add my app to UIActivityViewController? Like Facebook, Vimeo and YouTube in this screenshot:

我已经在info.plist文件中编写了以下代码,但未在应用中显示!

I have write below code in info.plist file but it’s not showing in the app!

<key>CFBundleDocumentTypes</key>
<array>
    <dict>
        <key>CFBundleTypeName</key>
        <string>Video</string>
        <key>LSHandlerRank</key>
        <string>Alternate</string>
        <key>LSItemContentTypes</key>
        <array>
            <string>public.video</string>
        </array>
    </dict>
</array>

,我已经看到了此帖子但我不知道该怎么做.

and I have seen this post but I do not understand how to do that.

推荐答案

尝试使用public.movie而不是public.video并添加CFBundleTypeRole键.

Try using public.movie instead of public.video and also add a CFBundleTypeRole key.

<key>CFBundleDocumentTypes</key>
<array>
    <dict>
        <key>CFBundleTypeName</key>
        <string>Video</string>
        <key>CFBundleTypeRole</key>
        <string>Viewer</string>
        <key>LSHandlerRank</key>
        <string>Alternate</string>
        <key>LSItemContentTypes</key>
        <array>
            <string>public.movie</string>
        </array>
    </dict>
</array>

这篇关于如何在UIActivityViewController中添加应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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