开发者

Attempting to load GPX and KML format files from Mail and Safari using CFBundleDocumentTypes on IPhone

开发者 https://www.devze.com 2023-01-29 07:47 出处:网络
I\'ve setup other binary document types (such as zip archives) and they load from Safari and Mail just fine. But the XML based formats only run the \"Quick View\" and show the raw XML code. Is there s

I've setup other binary document types (such as zip archives) and they load from Safari and Mail just fine. But the XML based formats only run the "Quick View" and show the raw XML code. Is there something else that needs to be done to support XML based formats? Here is the info.plist I am using for these types:

<key>CFBundleDocumentTypes</key>  
<array>
 <dict>
   <key>CFBundleTypeIconFiles</key>
<array>
    <string>Icon-72.png</string>
    <string>Icon.png</string>
   </array>
   <key>CFBundleTypeName</key>
   <string>GPS Exchange Format (GPX)</string>
   <key>CFBundleTypeRole</key>
   <string>Viewer</string>
   <key>LSHandlerRank</key>
   <string>Owner</string>
   <key>LSItemContentTypes</key>
   <array>
    <string>com.topografix.gpx</string>
   </array>
  </dict>
  <dict>
   <key>CFBundleTypeIconFiles</key>
   <array>
    <string>Icon-72.png</string>
    <string>Icon.png</string>
   </array>
   <key>CFBundleTypeName</key>
   <string>Google Earth KML</string>
   <key>CFBundleTypeRole</key>
   <string>Viewer</string>
   <key>LSHandlerRank</key>
   <string>Owner</string>
   <key>LSItemContentTypes</key>
   <array>
    <string>com.google.earth.kml</string>
   </array>
  </dict>
 </array>
 <key>UTExportedTypeDeclarations</key>
 <array>
  <dict>
   <key>UTTypeIdentifier</key>
   <string>com.google.earth.kml</string>
   <key>UTTypeDescription</key>
   <string>Google Earth KML</string>
   <key>UTTypeReferenceURL</key>
   <string>http://earth.google.com/kml/</string>
   <key>UTTypeTagSpecification</key>
   <dict>
    <key>com.apple.ostype</key>
    <string>GKml</string>
    <key>public.filename-extension</key>
    <array>
     <string>kml</string>
    </array>
    <key>public.mime-type</key>
    <string>application/vnd.google-earth.kml+xml</string>
   </dict>
   <key>UTTypeConformsTo</key>
   <array>
    <string>public.xml</string>
   </array>
  </dict>
  <dict>
   <key>UTTypeIdentifier</key>
   <string>com.topografix.gpx</string>
   <key>UTTypeReferenceURL</key>
   <string>http://www.topografix.com/GPX/1/1/</string>
   <key>UTTypeDescription</key>
   <string>GPS Exchange Format (GPX)</string>
   <key>UTTypeTagSpe开发者_JAVA技巧cification</key>
   <dict>
    <key>public.filename-extension</key>
    <array>
     <string>gpx</string>
    </array>
    <key>public.mime-type</key>
    <string>application/gpx+xml</string>
   </dict>
   <key>UTTypeConformsTo</key>
   <array>
    <string>public.xml</string>
   </array>
  </dict>
 </array>
 <key>UTImportedTypeDeclarations</key>
 <array>
  <dict>
   <key>UTTypeIdentifier</key>
   <string>com.google.earth.kml</string>
   <key>UTTypeDescription</key>
   <string>Google Earth KML</string>
   <key>UTTypeReferenceURL</key>
   <string>http://earth.google.com/kmz/</string>
   <key>UTTypeTagSpecification</key>
   <dict>
    <key>com.apple.ostype</key>
    <string>GKml</string>
    <key>public.filename-extension</key>
    <array>
     <string>kml</string>
    </array>
    <key>public.mime-type</key>
    <string>application/vnd.google-earth.kml+xml</string>
   </dict>
   <key>UTTypeConformsTo</key>
   <array>
    <string>public.xml</string>
   </array>
  </dict>
  <dict>
   <key>UTTypeIdentifier</key>
   <string>com.topografix.gpx</string>
   <key>UTTypeDescription</key>
   <string>GPS Exchange Format (GPX)</string>
   <key>UTTypeReferenceURL</key>
   <string>http://www.topografix.com/GPX/1/1/</string>
   <key>UTTypeTagSpecification</key>
   <dict>
    <key>public.filename-extension</key>
    <array>
     <string>gpx</string>
    </array>
    <key>public.mime-type</key>
    <string>application/gpx+xml</string>
   </dict>
   <key>UTTypeConformsTo</key>
   <array>
    <string>public.xml</string>
   </array>
  </dict>
 </array>
</dict>
0

精彩评论

暂无评论...
验证码 换一张
取 消