IOS及Android文件类型关联的Delphi示例
由 hubdog 于 星期日, 2015-09-27 13:37 发表
Android要匹配任意扩展名,注意要改成
<intent-filter> <action android:name="android.intent.action.VIEW"></action> <category android:name="android.intent.category.DEFAULT"></category> <data android:mimeType="*/*"></data> </intent-filter> 如果你想关联发送共享之类的,可以加上 <intent-filter> <action android:name="android.intent.action.SEND" /> <category android:name="android.intent.category.DEFAULT" /> <data android:mimeType="*/*" /> </intent-filter>
ios下关联任意文件,要改成
<key>CFBundleDocumentTypes</key> <array> <dict> <key>CFBundleTypeName</key> <string>com.myapp.common-data</string> <key>LSItemContentTypes</key> <array> <string>com.microsoft.powerpoint.ppt</string> <string>public.item</string> <string>com.microsoft.word.doc</string> <string>com.adobe.pdf</string> <string>com.microsoft.excel.xls</string> <string>public.image</string> <string>public.content</string> <string>public.composite-content</string> <string>public.archive</string> <string>public.audio</string> <string>public.movie</string> <string>public.text</string> <string>public.data</string> </array> </dict> </array>
附件 | 大小 |
---|---|
FileAssoc.zip | 18.38 KB |
LinkFile.zip | 12.5 KB |