简体   繁体   中英

How do I register my iOS app to open zip files from within the mail app in iOS 6+?

I have an app which I've registered to open zip files by adding the following to the info.plist:

<dict>
    <key>CFBundleTypeName</key>
    <string>Zip archive</string>
    <key>CFBundleTypeRole</key>
    <string>Editor</string>
    <key>LSHandlerRank</key>
    <string>Alternate</string>
    <key>LSItemContentTypes</key>
    <array>
        <string>com.pkware.zip-archive</string>
    </array>
</dict>

In iOS 5, this was enough that the mail app would offer to open zip files in my app. In iOS 6, it's not; the file doesn't use my app's icon and my app doesn't appear in the list. (It does use the icon in mail compose views, though)

I've tried changing the CFBundleTypeRole to Viewer, and the LSHandlerRank to Default and even to Owner. Do I need to add something else to get it to work in iOS 6? Or have they just removed the ability to open zip files from the mail app?

The following is what works for me in IOS 7.

<dict>
  <key>CFBundleTypeName</key>
  <string>Zip archive</string>
  <key>CFBundleTypeRole</key>
  <string>Editor</string>
  <key>LSItemContentTypes</key>
  <array>
    <string>com.pkware.zip-archive</string>
  </array>
  <key>UTTypeTagSpecification</key>
  <dict>
    <key>public.filename-extension</key>
    <string>zip</string>
    <key>public.mime-type</key>
    <string>application/zip</string>
  </dict>
  <key>LSHandlerRank</key>
  <string>Owner</string>
</dict>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM