IOS 8 open image in my app from another apps

后端 未结 2 1939
我寻月下人不归
我寻月下人不归 2021-01-15 20:17

I did some research but seems still no luck

when I added these xml in my info.plist

UTImportedTypeDeclarations
    

        
相关标签:
2条回答
  • 2021-01-15 20:28

    It all depends on how "share" button in the host app is implemented. In iOS8, there are actually two different ways to do this: (1) using CFBundleDocumentTypes in Info.plist, and (2) Application Extension. Some apps such as GMail & AVR support both (1) & (2). But Dropbox supports (2) only. That's why CFBundleDocumentTypes does not work in Dropbox anymore. Of course, things may change later.

    0 讨论(0)
  • 2021-01-15 20:55

    In my app, I don't use key UTImportedTypeDeclarations. You can remove it and try with below:

    <key>CFBundleDocumentTypes</key>
    <array>
        <dict>
            <key>CFBundleTypeName</key>
            <string>Image</string>
            <key>LSHandlerRank</key>
            <string>Alternate</string>
            <key>LSItemContentTypes</key>
            <array>
                <string>public.image</string>
            </array>
        </dict>
        <dict>
            <key>CFBundleTypeName</key>
            <string>OpenDocument Text</string>
            <key>LSHandlerRank</key>
            <string>Alternate</string>
            <key>LSItemContentTypes</key>
            <array>
                <string>org.oasis.opendocument.text</string>
            </array>
        </dict>
        <dict>
            <key>CFBundleTypeName</key>
            <string>GIF image</string>
            <key>LSHandlerRank</key>
            <string>Alternate</string>
            <key>LSItemContentTypes</key>
            <array>
                <string>com.compuserve.gif</string>
            </array>
        </dict>
        <dict>
            <key>CFBundleTypeName</key>
            <string>PNG image</string>
            <key>LSHandlerRank</key>
            <string>Alternate</string>
            <key>LSItemContentTypes</key>
            <array>
                <string>public.png</string>
            </array>
        </dict>
        <dict>
            <key>CFBundleTypeName</key>
            <string>TIFF image</string>
            <key>LSHandlerRank</key>
            <string>Alternate</string>
            <key>LSItemContentTypes</key>
            <array>
                <string>public.tiff</string>
            </array>
        </dict>
        <dict>
            <key>CFBundleTypeName</key>
            <string>JPEG image</string>
            <key>LSHandlerRank</key>
            <string>Alternate</string>
            <key>LSItemContentTypes</key>
            <array>
                <string>public.jpeg</string>
            </array>
        </dict>
        <dict>
            <key>CFBundleTypeName</key>
            <string>Rich Text</string>
            <key>LSHandlerRank</key>
            <string>Alternate</string>
            <key>LSItemContentTypes</key>
            <array>
                <string>public.rtf</string>
                <string>com.apple.rtfd</string>
                <string>com.apple.flat-rtfd</string>
            </array>
        </dict>
        <dict>
            <key>CFBundleTypeName</key>
            <string>Text</string>
            <key>LSHandlerRank</key>
            <string>Alternate</string>
            <key>LSItemContentTypes</key>
            <array>
                <string>public.text</string>
                <string>public.plain-text</string>
                <string>public.utf8-plain-text</string>
                <string>public.utf16-external-plain-​text</string>
                <string>public.utf16-plain-text</string>
                <string>com.apple.traditional-mac-​plain-text</string>
                <string>public.source-code</string>
                <string>public.c-source</string>
                <string>public.objective-c-source</string>
                <string>public.c-plus-plus-source</string>
                <string>public.objective-c-plus-​plus-source</string>
                <string>public.c-header</string>
                <string>public.c-plus-plus-header</string>
                <string>com.sun.java-source</string>
                <string>public.script</string>
                <string>public.shell-script</string>
            </array>
        </dict>
        <dict>
            <key>CFBundleTypeName</key>
            <string>PDF</string>
            <key>LSHandlerRank</key>
            <string>Alternate</string>
            <key>LSItemContentTypes</key>
            <array>
                <string>com.adobe.pdf</string>
            </array>
        </dict>
    </array>
    
    0 讨论(0)
提交回复
热议问题