2012-02-13 11 views
28

मैं पंजीकरण प्रक्रिया को कार्यान्वित करने की कोशिश कर रहा हूं जो मेरे आईओएस ऐप को अन्य अनुप्रयोगों की सूची में "खोलें" में दिखाएगा (जैसा कि Apple's Document Interaction Programming Topics में वर्णित है)। मैं चाहता हूं कि मेरा ऐप किसी ऐप से ऑडियो को संभालने में सक्षम हो जो मानक ऑडियो फ़ाइल प्रारूप (एमपी 3, एआईएफएफ, डब्ल्यूएवी, इत्यादि) प्रदान करेगा।मेरा आईओएस ऐप अन्य ऐप 'ओपन इन "संवाद में क्यों नहीं दिख रहा है?

जैसा कि मैं इसे समझता हूं, मुझे बस इतना करना चाहिए कि प्रासंगिक सबडाटा के साथ CFBundleDocumentTypes कुंजी, मेरे ऐप की Info.plist पर जोड़ें। यह मैं में क्या रखा (Xcode 4 दस्तावेज़ प्रकार संपादक के माध्यम से) है:

<key>CFBundleDocumentTypes</key> 
<array> 
    <dict> 
     <key>CFBundleTypeIconFiles</key> 
     <array> 
      <string>scrubbulator-icon</string> 
     </array> 
     <key>CFBundleTypeName</key> 
     <string>Audio</string> 
     <key>LSHandlerRank</key> 
     <string>Alternative</string> 
     <key>LSItemContentTypes</key> 
     <array> 
     <string>public.mp3</string> 
     </array> 
    </dict> 
</array> 

इस कोड के अलावा ऐप्स 'में मेरे एप्लिकेशन दिखाई नहीं दे रहा मेनू "इसमें खोलें" (मैं एक iPhone पर परीक्षण कर रहा हूँ, एक का उपयोग कर ड्रॉपबॉक्स में एमपी 3 फ़ाइल स्रोत के रूप में। एप्स ऑडियोमोमोस और ईरर्नोट दोनों ड्रॉपबॉक्स में एमपी 3 फ़ाइल के लिए प्रदर्शित होते हैं, इसलिए मुझे पता है कि प्रारूप समर्थित है)। क्या कुछ स्पष्ट है कि मैं गलत कर रहा हूं, या क्या मुझे कुछ और लागू करने की आवश्यकता है?

(नोट: मैंने अपनी जानकारी.प्लिस्ट में UTExportedTypeDeclarations आइटम सेट नहीं किया है, क्योंकि मैं इसे केवल कस्टम यूटीआई के लिए जरूरी समझता हूं। जैसा कि मैं सिस्टम यूटीआई का उपयोग कर रहा हूं, मुझे विश्वास है कि यह आवश्यक नहीं होना चाहिए, लेकिन कृपया मुझे सही कर अगर मैं गलत हूँ)

संपादित

मुझे कोई सफलता के साथ निम्नलिखित निर्यात प्रकार यूटीआई जोड़ दिया है,:।

<key>UTExportedTypeDeclarations</key> 
<array> 
    <dict> 
     <key>UTTypeConformsTo</key> 
     <array> 
     <string>kUTTypeMP3</string> 
     </array> 
     <key>UTTypeDescription</key> 
     <string>Audio file</string> 
     <key>UTTypeIdentifier</key> 
     <string>kUTTypeMP3</string> 
     <key>UTTypeTagSpecification</key> 
     <dict> 
     <key>public.filename-extension</key> 
     <array> 
      <string>mp3</string> 
     </array> 
     </dict> 
    </dict> 
</array> 

उत्तर

55

सभी मानक फ़ाइल स्वरूप के लिए:

<key>CFBundleDocumentTypes</key> 
<array> 
    <dict> 
     <key>CFBundleTypeName</key> 
     <string>Unknown File</string> 
     <key>LSHandlerRank</key> 
     <string>Alternate</string> 
     <key>LSItemContentTypes</key> 
     <array> 
      <string>public.calendar-event</string> 
      <string>public.database</string> 
      <string>public.executable</string> 
      <string>public.data</string> 
      <string>public.content </string> 
      <string>public.item</string> 
     </array> 
    </dict> 
    <dict> 
     <key>CFBundleTypeName</key> 
     <string>Video</string> 
     <key>LSHandlerRank</key> 
     <string>Alternate</string> 
     <key>LSItemContentTypes</key> 
     <array> 
      <string>public.video</string> 
     </array> 
    </dict> 
    <dict> 
     <key>CFBundleTypeName</key> 
     <string>Image</string> 
     <key>LSHandlerRank</key> 
     <string>Alternate</string> 
     <key>LSItemContentTypes</key> 
     <array> 
      <string>public.image</string> 
     </array> 
    </dict> 
    <dict> 
     <key>CFBundleTypeName</key> 
     <string>Web Archive</string> 
     <key>LSHandlerRank</key> 
     <string>Alternate</string> 
     <key>LSItemContentTypes</key> 
     <array> 
      <string>com.apple.webarchive</string> 
     </array> 
    </dict> 
    <dict> 
     <key>CFBundleTypeName</key> 
     <string>iWork Keynote</string> 
     <key>LSHandlerRank</key> 
     <string>Alternate</string> 
     <key>LSItemContentTypes</key> 
     <array> 
      <string>com.apple.keynote.key</string> 
      <string>com.apple.iwork.keynote.key</string> 
      <string>com.apple.iwork.keynote.kth</string> 
     </array> 
    </dict> 
    <dict> 
     <key>CFBundleTypeName</key> 
     <string>iWork Numbers</string> 
     <key>LSHandlerRank</key> 
     <string>Alternate</string> 
     <key>LSItemContentTypes</key> 
     <array> 
      <string>com.apple.numbers.numbers</string> 
      <string>com.apple.iwork.numbers.numbers</string> 
      <string>com.apple.iwork.numbers.template</string> 
     </array> 
    </dict> 
    <dict> 
     <key>CFBundleTypeName</key> 
     <string>iWork Pages</string> 
     <key>LSHandlerRank</key> 
     <string>Alternate</string> 
     <key>LSItemContentTypes</key> 
     <array> 
      <string>com.apple.page.pages</string> 
      <string>com.apple.iwork.pages.pages</string> 
      <string>com.apple.iwork.pages.template</string> 
     </array> 
    </dict> 
    <dict> 
     <key>CFBundleTypeName</key> 
     <string>OpenDocument Spreadsheet</string> 
     <key>LSHandlerRank</key> 
     <string>Alternate</string> 
     <key>LSItemContentTypes</key> 
     <array> 
      <string>org.oasis.opendocument.spreadsheet</string> 
     </array> 
    </dict> 
    <dict> 
     <key>CFBundleTypeName</key> 
     <string>OpenDocument Presentation</string> 
     <key>LSHandlerRank</key> 
     <string>Alternate</string> 
     <key>LSItemContentTypes</key> 
     <array> 
      <string>org.oasis.opendocument.presentation</string> 
     </array> 
    </dict> 
    <dict> 
     <key>CFBundleTypeName</key> 
     <string>OpenDocument Text</string> 
     <key>LSHandlerRank</key> 
     <string>Alternate</string> 
     <key>LSItemContentTypes</key> 
     <array> 
      <string>org.oasis.opendocument.text</string> 
     </array> 
    </dict> 
    <dict> 
     <key>CFBundleTypeName</key> 
     <string>Folder</string> 
     <key>LSHandlerRank</key> 
     <string>Alternate</string> 
     <key>LSItemContentTypes</key> 
     <array> 
      <string>public.folder</string> 
     </array> 
    </dict> 

<dict> 
     <key>CFBundleTypeName</key> 
     <string>Audio</string> 
     <key>LSHandlerRank</key> 
     <string>Alternate</string> 
     <key>LSItemContentTypes</key> 
     <array> 
      <string>public.audio</string> 
      <string>public.mp3</string> 
      <string>public.mpeg-4-audio</string> 
      <string>com.apple.protected-​mpeg-4-audio</string> 
      <string>public.aifc-audio</string> 
      <string>com.apple.coreaudio-​format</string> 
      <string>public.aiff-audio</string> 
     </array> 
    </dict> 

<dict> 
     <key>CFBundleTypeName</key> 
     <string>Movie</string> 
     <key>LSHandlerRank</key> 
     <string>Alternate</string> 
     <key>LSItemContentTypes</key> 
     <array> 
      <string>public.movie</string> 
      <string>public.3gpp2</string> 
      <string>public.3gpp</string> 
      <string>public.mpeg</string> 
      <string>com.apple.quicktime-movie</string> 
      <string>public.mpeg-4</string> 
     </array> 
    </dict> 
    <dict> 
     <key>CFBundleTypeName</key> 
     <string>GIF image</string> 
     <key>LSHandlerRank</key> 
     <string>Alternate</string> 
     <key>LSItemContentTypes</key> 
     <array> 
      <string>com.compuserve.gif</string> 
     </array> 
    </dict> 
    <dict> 
     <key>CFBundleTypeName</key> 
     <string>PNG image</string> 
     <key>LSHandlerRank</key> 
     <string>Alternate</string> 
     <key>LSItemContentTypes</key> 
     <array> 
      <string>public.png</string> 
     </array> 
    </dict> 
    <dict> 
     <key>CFBundleTypeName</key> 
     <string>TIFF image</string> 
     <key>LSHandlerRank</key> 
     <string>Alternate</string> 
     <key>LSItemContentTypes</key> 
     <array> 
      <string>public.tiff</string> 
     </array> 
    </dict> 
    <dict> 
     <key>CFBundleTypeName</key> 
     <string>JPEG image</string> 
     <key>LSHandlerRank</key> 
     <string>Alternate</string> 
     <key>LSItemContentTypes</key> 
     <array> 
      <string>public.jpeg</string> 
     </array> 
    </dict> 
    <dict> 
     <key>CFBundleTypeName</key> 
     <string>XML</string> 
     <key>LSHandlerRank</key> 
     <string>Alternate</string> 
     <key>LSItemContentTypes</key> 
     <array> 
      <string>public.xml</string> 
     </array> 
    </dict> 
    <dict> 
     <key>CFBundleTypeName</key> 
     <string>HTML</string> 
     <key>LSHandlerRank</key> 
     <string>Alternate</string> 
     <key>LSItemContentTypes</key> 
     <array> 
      <string>public.html</string> 
      <string>public.xhtml</string> 
     </array> 
    </dict> 
    <dict> 
     <key>CFBundleTypeName</key> 
     <string>Rich Text</string> 
     <key>LSHandlerRank</key> 
     <string>Alternate</string> 
     <key>LSItemContentTypes</key> 
     <array> 
      <string>public.rtf</string> 
      <string>com.apple.rtfd</string> 
      <string>com.apple.flat-rtfd</string> 
     </array> 
    </dict> 
    <dict> 
     <key>CFBundleTypeName</key> 
     <string>Text</string> 
     <key>LSHandlerRank</key> 
     <string>Alternate</string> 
     <key>LSItemContentTypes</key> 
     <array> 
      <string>public.text</string> 
      <string>public.plain-text</string> 
      <string>public.utf8-plain-text</string> 
      <string>public.utf16-external-plain-​text</string> 
      <string>public.utf16-plain-text</string> 
      <string>com.apple.traditional-mac-​plain-text</string> 
      <string>public.source-code</string> 
      <string>public.c-source</string> 
      <string>public.objective-c-source</string> 
      <string>public.c-plus-plus-source</string> 
      <string>public.objective-c-plus-​plus-source</string> 
      <string>public.c-header</string> 
      <string>public.c-plus-plus-header</string> 
      <string>com.sun.java-source</string> 
      <string>public.script</string> 
      <string>public.shell-script</string> 
     </array> 
    </dict> 
    <dict> 
     <key>CFBundleTypeExtensions</key> 
     <array> 
      <string>zip</string> 
      <string>zipx</string> 
     </array> 
     <key>CFBundleTypeName</key> 
     <string>Zip archive</string> 
     <key>LSHandlerRank</key> 
     <string>Alternate</string> 
     <key>LSItemContentTypes</key> 
     <array> 
      <string>public.zip-archive</string> 
      <string>public.archive</string> 
      <string>com.pkware.zip-archive</string> 
      <string>com.pkware.zipx-archive</string> 
     </array> 
    </dict> 
    <dict> 
     <key>CFBundleTypeExtensions</key> 
     <array> 
      <string>rar</string> 
      <string>RAR</string> 
     </array> 
     <key>CFBundleTypeName</key> 
     <string>Rar archive</string> 
     <key>LSHandlerRank</key> 
     <string>Alternate</string> 
     <key>LSItemContentTypes</key> 
     <array> 
      <string>com.rarlab.rar-archive</string> 
      <string>public.archive</string> 
     </array> 
    </dict> 
    <dict> 
     <key>CFBundleTypeExtensions</key> 
     <array> 
      <string>7z</string> 
      <string>7Z</string> 
     </array> 
     <key>CFBundleTypeName</key> 
     <string>7z archive</string> 
     <key>LSHandlerRank</key> 
     <string>Alternate</string> 
     <key>LSItemContentTypes</key> 
     <array> 
      <string>org.7-zip.7-zip-archive</string> 
      <string>public.archive</string> 
     </array> 
    </dict> 
    <dict> 
     <key>CFBundleTypeName</key> 
     <string>Waveform audio</string> 
     <key>LSHandlerRank</key> 
     <string>Alternate</string> 
     <key>LSItemContentTypes</key> 
     <array> 
      <string>com.microsoft.waveform-​audio</string> 
     </array> 
    </dict> 
    <dict> 
     <key>CFBundleTypeName</key> 
     <string>Windows icon image</string> 
     <key>LSHandlerRank</key> 
     <string>Alternate</string> 
     <key>LSItemContentTypes</key> 
     <array> 
      <string>com.microsoft.ico</string> 
      <string>com.apple.icns</string> 
     </array> 
    </dict> 
    <dict> 
     <key>CFBundleTypeName</key> 
     <string>Windows bitmap image</string> 
     <key>LSHandlerRank</key> 
     <string>Alternate</string> 
     <key>LSItemContentTypes</key> 
     <array> 
      <string>com.microsoft.bmp</string> 
     </array> 
    </dict> 
    <dict> 
     <key>CFBundleTypeName</key> 
     <string>Microsoft PowerPoint</string> 
     <key>LSHandlerRank</key> 
     <string>Alternate</string> 
     <key>LSItemContentTypes</key> 
     <array> 
      <string>com.microsoft.powerpoint.​ppt</string> 
      <string>org.openxmlformats.presentationml.presentation</string> 
     </array> 
    </dict> 
    <dict> 
     <key>CFBundleTypeName</key> 
     <string>Microsoft Excel</string> 
     <key>LSHandlerRank</key> 
     <string>Alternate</string> 
     <key>LSItemContentTypes</key> 
     <array> 
      <string>org.openxmlformats.spreadsheetml.sheet</string> 
      <string>com.microsoft.excel.xls</string> 
     </array> 
    </dict> 
    <dict> 
     <key>CFBundleTypeName</key> 
     <string>Microsoft Word</string> 
     <key>LSHandlerRank</key> 
     <string>Alternate</string> 
     <key>LSItemContentTypes</key> 
     <array> 
      <string>com.microsoft.word.doc</string> 
      <string>com.microsoft.word.wordml</string> 
      <string>org.openxmlformats.wordprocessingml.document</string> 
     </array> 
    </dict> 
    <dict> 
     <key>CFBundleTypeName</key> 
     <string>PDF</string> 
     <key>LSHandlerRank</key> 
     <string>Alternate</string> 
     <key>LSItemContentTypes</key> 
     <array> 
      <string>com.adobe.pdf</string> 
     </array> 
    </dict> 
</array> 
+1

मैं इसे वास्तव में क्या तय नहीं है का उपयोग करना चाहिए, लेकिन मैं से ऑडियो अनुभाग की नकल की अपनी उपरोक्त कोड और अब यह काम करता है! धन्यवाद! (मैंने आपके द्वारा कॉपी किए गए ऑडियो अनुभाग को हाइलाइट करने के लिए अपना कोड संपादित किया है।) –

+0

भविष्य के संदर्भ के लिए, निर्यात करने के लिए निर्यात और आयातित प्रकार यूटीआई आवश्यक नहीं थे। –

+0

इस पोस्ट के लिए अच्छी तरह से काम करने के लिए आपको बहुत धन्यवाद ... महान काम –

5

आप Alternate के बजाय Alternative

<key>LSHandlerRank</key> 
<string>Alternate</string> 
0
<key>CFBundleDocumentTypes</key> 
<array> 
    <dict> 
     <key>CFBundleTypeExtensions</key> 
     <array> 
      <string>"*"</string> 
     </array> 
     <key>CFBundleTypeName</key> 
     <string>Unknown</string> 
     <key>LSItemContentTypes</key> 
     <array> 
      <string>public.data</string> 
     </array> 
    </dict> 
</array> 
संबंधित मुद्दे