UIDocumentBrowserViewController 忽略 iOS13 设备上的文档类型 (com.apple.pkpass)

UIDocumentBrowserViewController ignoring Document Type (com.apple.pkpass) on iOS13 device

当 运行 在 iOS13 (beta 5) 设备上时,UIDocumentBrowserViewController 不允许 selection 文档类型“com.apple.pkpass”(钱包 PKPass)先前设置在 Target 的设置中。同一项目在 iOS12 设备上运行良好。

要重现该问题,只需使用“基于文档的应用程序”模板创建一个新项目(最好使用 Xcode 10 / iOS12)。

然后在 Target 设置的“信息”选项卡中添加以下文档类型(保留由模板创建的“图像”条目):

Name: "PKPass"

Types: "com.apple.pkpass"

Additional document type properties:

  • CFBundleTypeRole String "Viewer"

  • LSHandlerRank String "Alternate"

当 运行 在 iOS 12 设备上执行此操作时,您将能够看到和 select .pkpass 文件(我在我的 iCloud Drive 上使用之前导出的 pkPasses 执行此操作来自我的钱包)。

当 运行 在 iOS13 设备上时,.pkpass 文件可见,但半透明且不 select 可见。图像(文档类型已经在“基于文档的应用程序”中设置)但是按预期工作。使用 Xcode 11 (beta 5) 创建项目会导致相同的结果。

这是 iOS 13 中的错误还是我错过了一些更改或新要求?

PKPass 文档有两种类型 com.apple.pkpass 和 com.apple.pkpass-data。你应该保留他们两个。