我正在开发一个具有文件扩展名的 iOS 应用程序,例如.vlin,我希望 iOS 设备能够识别这个扩展名。到目前为止,我能够实现以下目标
.vliniphone本机邮件客户端支持- 单击
.vlin文件在我的应用程序中打开Vlin。
我正在使用 cordova 并在 config.xml 中添加了配置设置
但不知何故,它不适用于 iOS Safari 浏览器。如果我尝试在 iOS Safari 中打开文件,它会在浏览器本身中作为文本文件打开。我希望它在我的VliniOS 应用程序中打开。
我的 info.plist 和 config.xml 代码是:
<platform name="ios">
<preference name="IosLaunchMode" value="singleTask" />
<config-file platform="ios" target="*-Info.plist" parent="UIFileSharingEnabled">
<true />
</config-file>
<config-file platform="ios" target="*-Info.plist" parent="CFBundleDocumentTypes">
<array>
<dict>
<key>CFBundleTypeName</key>
<string>com.example.vlin.vlin</string>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>LSHandlerRank</key>
<string>Owner</string>
<key>LSItemContentTypes</key>
<array>
<string>com.example.vlin.vlin</string>
</array>
</dict>
</array>
</config-file>
<config-file platform="ios" target="*-Info.plist" parent="UTExportedTypeDeclarations">
<array>
<dict>
<key>UTTypeConformsTo</key>
<array>
<string>public.data</string>
</array>
<key>UTTypeDescription</key>
<string>Vlin document</string>
<key>UTTypeIdentifier</key>
<string>com.example.vlin.vlin</string>
<key>UTTypeTagSpecification</key>
<dict>
<key>public.filename-extension</key>
<string>vlin</string>
</dict>
</dict>
</array>
</config-file>
非常感谢任何帮助,在此先感谢。
信息列表
<key>UIFileSharingEnabled</key> <true/> <key>CFBundleDocumentTypes</key> <array> <dict> <key>CFBundleTypeName</key> <string>com.example.vlin.vlin</string> <key>CFBundleTypeRole</key> <string>Editor</string> <key>LSHandlerRank</key> <string>Owner</string> <key>LSItemContentTypes</key> <array> <string>com.example.vlin.vlin</string> </array> </dict> </array> <key>UTExportedTypeDeclarations</key> <array> <dict> <key>UTTypeConformsTo</key> <array> <string>public.data</string> </array> <key>UTTypeDescription</key> <string>Vlin document</string> <key>UTTypeIdentifier</key> <string>com.example.vlin.vlin</string> <key>UTTypeTagSpecification</key> <dict> <key>public.filename-extension</key> <string>vlin</string> </dict> </dict> </array> </dict>
样本文件格式:invite.vlin
{
"invite”: {
"name": “Some College",
"identifier": “xxxxxxxxxxxxxxxxx”
},
“value”: “xxxxxxxxxxxxxx”
}