Reputation: 2128
I want to read .ppt
files from the iPhone mail app. I have already done read the PDF file using this SO question. It's working fine, and they used this code for generating the menu in the mail app:
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeName</key>
<string>PDF Document</string>
<key>LSHandlerRank</key>
<string>Alternate</string>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
<key>LSItemContentTypes</key>
<array>
<string>com.adobe.pdf</string>
</array>
</dict>
</array>
<key>UIFileSharingEnabled</key>
<true/>
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeName</key>
<string>Powerpoint</string>
<key>LSHandlerRank</key>
<string>Alternate</string>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
<key>LSItemContentTypes</key>
<array>
<string>com.microsoft.powerpoint.ppt</string>
</array>
</dict>
</array>
It's working fine. I googled the problem, but if someone could guide me how to detect .ppt
files from mail attachments, that'd be helpful.
Upvotes: 1
Views: 948
Reputation: 8076
The issue here is that you shouldn't have duplicated the entire CFBundleDocumentTypes
entry like you have for pdf
s and ppt
s.
Rather, you only need one of these such blocks, and you simply want to add another CFBundleTypeName
to the .
So, your plist should look like this:
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeName</key>
<string>PDF Document</string>
<key>LSHandlerRank</key>
<string>Alternate</string>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
<key>LSItemContentTypes</key>
<array>
<string>com.adobe.pdf</string>
</array>
</dict>
<dict>
<key>CFBundleTypeName</key>
<string>Powerpoint</string>
<key>LSHandlerRank</key>
<string>Alternate</string>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
<key>LSItemContentTypes</key>
<array>
<string>com.microsoft.powerpoint.ppt</string>
</array>
</dict>
</array>
<key>UIFileSharingEnabled</key>
<true/>
Notice that I didn't end the CFBundleDocumentTypes
array until I had added both entries.
Upvotes: 0
Reputation: 43330
In order to use PPT files, you must declare your intent to conform to its UTI, which means simply changing the bit about com.adobe.pdf
to com.microsoft.powerpoint.ppt
. Easy.
For all intents and purposes, also change CFBundleTypeName
to Powerpoint
.
Upvotes: 1