आप कॉर्डोवा में फ़ाइलटाइप एसोसिएशन प्राप्त कर सकते हैं।
इसमें 2 चरण शामिल हैं।
1)
प्रकट
<intent-filter
android:icon='@drawable/ic_launcher'
android:label='AndroidMHT File'
android:priority='1'>
<action android:name="android.intent.action.VIEW" />
<action android:name="android.intent.action.EDIT" />
<action android:name="android.intent.action.PICK" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:mimeType="*/*" />
<data android:pathPattern="*.mht" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="http" android:host="*" android:pathPattern=".*\\.mht" />
<data android:scheme="https" android:host="*" android:pathPattern=".*\\.mht" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:mimeType="message/rfc822" android:scheme="http" />
<data android:mimeType="multipart/related" android:scheme="http" />
<data android:mimeType="message/rfc822" android:scheme="https" />
<data android:mimeType="multipart/related" android:scheme="https" />
</intent-filter>
के रूप में एंड्रॉयड प्रकट/iOS plist फ़ाइलें रजिस्टर plist
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeIconFiles</key>
<array>
<string>Document-molecules-320.png</string>
<string>Document-molecules-64.png</string>
</array>
<key>CFBundleTypeName</key>
<string>Molecules Structure File</string>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
<key>LSHandlerRank</key>
<string>Owner</string>
<key>LSItemContentTypes</key>
<array>
<string>com.sunsetlakesoftware.molecules.pdb</string>
<string>org.gnu.gnu-zip-archive</string>
</array>
</dict>
</array>
2) का प्रयोग करें File Opener Plugin for Cordova
आप आवश्यक पारित करने के लिए आवश्यकता हो सकती है उन फ़ाइलों को खोलने के लिए झंडे।
संदर्भ: Android, iOS और एक phonegap community forum thread
आशा है कि यह मदद करता है।
स्रोत
2016-01-05 11:42:27
लिंक के लिए धन्यवाद (मैंने एंड्रॉइड एक तय किया है)। मुझे परीक्षण करने का मौका नहीं मिला है, लेकिन यह सही दृष्टिकोण की तरह लगता है। एक वास्तविक प्लग-इन आसान होगा (जैसे एक यूआरएल योजना पंजीकृत करना), लेकिन मुझे लगता है कि मैं एक स्क्रिप्ट द्वारा प्लेलिस्ट परिवर्तन करने के लिए एक हुक का उपयोग कर सकता हूं। AFAIK, 'फ़ाइल ओपनर प्लगइन' प्रासंगिक नहीं है, यानी यह मेरे ऐप को किसी और की फाइल खोलने के लिए ओएस को बताएगा, जबकि यह प्रश्न केवल यह सुनिश्चित करने के बारे में है कि एक और ऐप (जैसे ईमेल) मेरे ऐप में फ़ाइल भेज सकता है । –
हाय, मैं वेबपैप पर फ़ाइल पता कैसे प्राप्त कर सकता हूं? (एक उपयोगकर्ता ने एक फोटो पर खुले दबाए, और अब उसे मेरे ऐप में स्थानांतरित किया जा रहा है, अगला क्या है?) –
कोई भी फ़ाइल को पकड़ने के लिए अगला कदम ढूंढने में सक्षम है? @DanielGolub? –