Reputation: 10083
Here are the pertinent contents of my app's info.plist file:
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeIconFiles</key>
<array>
<string>icon_72x72.png</string>
</array>
<key>CFBundleTypeName</key>
<string>MyApp File</string>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
<key>LSHandlerRank</key>
<string>Owner</string>
<key>LSItemContentTypes</key>
<array>
<string>com.myapp.export</string>
<string>com.myapp.backup</string>
<string>com.adobe.pdf</string>
<string>public.comma-separated-values-text</string>
<string>public.jpeg</string>
<string>public.png</string>
<string>com.microsoft.excel.xls</string>
</array>
</dict>
</array>
When I try to tap and hold on a XLS, CSV, or PDF attachment in Mail, the "Open in MyApp" option shows up and everything works fine as my app delegate's openURL method is fired. However, when I tap and hold on a PNG or JPG attachment in Mail, I do not get the option to open in my app.
Is there some other setting that I need to change in order to have images open in my app? I am thoroughly confused as to why some of the content types work and some don't.
I have seen quite a bit of the Apple documentation and other SO questions and blog posts, and still have not been able to get it working, so please don't just point out similar unanswered SO questions or Apple docs.
Upvotes: 2
Views: 1249
Reputation: 318774
You are not alone. This is an issue with the mail app in my opinion. The Photos app has the same issue. You can't choose to open a photo in the Photos app with any 3rd party app either. I can't figure out why Apple made this decision.
I suggest you file an enhancement request at bugreporter.apple.com.
Upvotes: 5