How to add app in UIActivityViewController

左心房为你撑大大i 提交于 2019-12-08 04:37:56

问题


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.

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

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.


回答1:


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>


来源:https://stackoverflow.com/questions/36396152/how-to-add-app-in-uiactivityviewcontroller

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!