Search code examples
iosimportpowerpointmime-typesuti

Can't Import .ppt Files Into My iOS App


I'm currently having an issue importing .ppt files into my iOS app. So far, every single one of these UTI's are working and allow me to import their corresponding file types into my app. This includes docx, doc, xslx, xsl, pptx. The ONLY one that refuses to let me import (my app's icon never shows up) is .ppt.

I used the UTI's from Apple's official site and it still does not work: https://developer.apple.com/library/content/documentation/Miscellaneous/Reference/UTIRef/Articles/System-DeclaredUniformTypeIdentifiers.html

Any ideas?

<key>CFBundleDocumentTypes</key>
<array>
    <dict>
        <key>CFBundleTypeName</key>
        <string>My Document File</string>
        <key>CFBundleTypeRole</key>
        <string>Viewer</string>
        <key>LSHandlerRank</key>
        <string>Owner</string>
        <key>LSItemContentTypes</key>
        <array>
            <string>com.microsoft.word.doc</string>
            <string>com.microsoft.word.wordml</string>
            <string>org.openxmlformats.wordprocessingml.document</string>
            <string>com.microsoft.excel.xls</string>
            <string>org.openxmlformats.spreadsheetml.sheet</string>
            <string>com.microsoft.powerpoint.​ppt</string>
            <string>org.openxmlformats.presentationml.presentation</string>
            <string>com.adobe.pdf</string>
            <string>com.microsoft.bmp</string>
            <string>public.jpeg</string>
            <string>public.png</string>
            <string>public.tiff</string>
            <string>com.compuserve.gif</string>
        </array>
    </dict>
</array>

Solution

  • Found out the reason. Do not copy and paste the UTI into your Plist file or any other string for that matter. It was the same exact characters except there was an invisible Unicode character between the '.' and 'ppt'. If you step through the string with arrow keys, you'll notice you must tap twice to move past the 'p' in 'ppt' because there is a character there.

    Once I typed out the UTI myself, it worked.