CFBundleDocumentType is not working in myproject-Info.plist file

后端 未结 2 795
南旧
南旧 2020-12-20 16:47

I am trying to build an app in ionic framework.

I am trying to build this functionality like when i click on photo from gallery and hit share A share pan will open

相关标签:
2条回答
  • 2020-12-20 17:15

    Set the UIFileSharingEnabled to YES. You missed to set it in plist.

    Hope this will resolve your issue.

    0 讨论(0)
  • 2020-12-20 17:26

    Several things are missing/wrong :

    • CFBundTypeIconFiles : I'm quite suire you need to specify the icons for your app to appear
    • CFBundleTypeName : You put the name of your application here
    • CFBundleTypeRole : I think you want "Viewer" here
    • LSHandlerRank : I think you want "Alternate" here (not sure you can be something else for a contentype like "public.jpeg")

    This is an example that works to register your application. It's tested and works for all types of data. Work your way down from there to target only public.jpeg :

    <key>CFBundleDocumentTypes</key>
    <array>
        <dict>
            <key>CFBundleTypeIconFiles</key>
            <array>
                <string>Icon-22x29.png</string>
                <string>Icon-44x58.png</string>
                <string>Icon-64x64.png</string>
                <string>Icon-320x320.png</string>
            </array>
            <key>CFBundleTypeName</key>
            <string>My App</string>
            <key>CFBundleTypeRole</key>
            <string>Viewer</string>
            <key>LSHandlerRank</key>
            <string>Alternate</string>
            <key>LSItemContentTypes</key>
            <array>
                <string>public.data</string>
            </array>
        </dict>
    </array>
    
    0 讨论(0)
提交回复
热议问题