1

I'm trying to add the option "open with" to my app... I tried to get help from here at stackoverflow and other topics and tutorials but didn't succeed..

I opened a new project, added a new Document Type like this:

<key>CFBundleDocumentTypes</key>
<array>
    <dict>
        <key>CFBundleTypeIconFiles</key>
        <array>
            <string>icon.png</string>
            <string>Icon@2x.png</string>
        </array>
        <key>CFBundleTypeName</key>
        <string>Open All Files</string>
        <key>LSHandlerRank</key>
        <string>Alternate</string>
        <key>LSItemContentTypes</key>
        <array>
            <string>public.content</string>
            <string>public.data</string>
            <string>public.audiovisual-content</string>
            <string>public.image</string>
            <string>public.jpeg</string>
            <string>public.jpeg-2000</string>
            <string>public.camera-raw-image</string>
            <string>public.png</string>
        </array>
    </dict>
</array>

then I ran the app with the simulator and with my iphone but I just can't open other photos with my app..

What am I doing wrong?

Community
  • 1
  • 1
DreamBit
  • 11
  • 2

1 Answers1

1

Check the modified plist content below

<key>CFBundleDocumentTypes</key>
    <array>
        <dict>
            <key>CFBundleTypeName</key>
            <string>PDF Document</string>
            <key>CFBundleTypeRole</key>
            <string>Viewer</string>
            <key>LSHandlerRank</key>
            <string>Alternate</string>
            <key>LSItemContentTypes</key>
            <array>
                <string>com.adobe.pdf</string>
            </array>
        </dict>
        <dict>
            <key>CFBundleTypeName</key>
            <string>PNG image</string>
            <key>CFBundleTypeRole</key>
            <string>Viewer</string>
            <key>LSHandlerRank</key>
            <string>Alternate</string>
            <key>LSItemContentTypes</key>
            <array>
                <string>public.png</string>
            </array>
        </dict>
        <dict>
            <key>CFBundleTypeName</key>
            <string>JPEG image</string>
            <key>CFBundleTypeRole</key>
            <string>Viewer</string>
            <key>LSHandlerRank</key>
            <string>Alternate</string>
            <key>LSItemContentTypes</key>
            <array>
                <string>public.jpeg</string>
            </array>
        </dict>
        <dict>
            <key>CFBundleTypeIconFiles</key>
            <array/>
            <key>CFBundleTypeName</key>
            <string>Generic Image</string>
            <key>LSItemContentTypes</key>
            <array>
                <string>public.image</string>
            </array>
        </dict>
      </array>
  • 1
    Thank you for your help :) I'll try it. I looked again at https://developer.apple.com/library/ios/documentation/FileManagement/Conceptual/DocumentInteraction_TopicsForIOS/Articles/RegisteringtheFileTypesYourAppSupports.html#//apple_ref/doc/uid/TP40010411-SW1 and apple doesn't mention ShareViewController.... Why? O_O – DreamBit Sep 30 '15 at 09:21
  • check the modified plist file. – Mahanthesh Kumbar Sep 30 '15 at 10:28