xcode 警告 ITMS-90737:“无效的文档配置
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/52262366/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
WARNING ITMS-90737: "Invalid Document Configuration
提问by sputn1k
I got this error message when uploading my app to ItunesConnect today,
我今天在将我的应用程序上传到 ItunesConnect 时收到此错误消息,
Invalid Document Configuration - Document Based Apps should support either the Document Browser (UISupportsDocumentBrowser = YES) or implement Open In Place (LSSupportsOpeningDocumentsInPlace = YES/NO). Visit https://developer.apple.com/document-based-apps/for more information.
无效的文档配置 - 基于文档的应用程序应该支持文档浏览器 (UISupportsDocumentBrowser = YES) 或实现就地打开 (LSSupportsOpeningDocumentsInPlace = YES/NO)。访问https://developer.apple.com/document-based-apps/了解更多信息。
回答by sputn1k
To Fix -
修理 -
Open Info.plist
file.
打开Info.plist
文件。
Ifyou have UIDocumentInteractionController
within your App use -
Add "UISupportsDocumentBrowser" select boolean YES
如果您UIDocumentInteractionController
在应用程序中使用 -
添加“UISupportsDocumentBrowser”选择布尔值是
Otherwise -
Add "LSSupportsOpeningDocumentsInPlace" select boolean YES
否则 -
添加“LSSupportsOpeningDocumentsInPlace”选择布尔值是
Info.plist
Code:
Info.plist
代码:
//if using - UIDocumentInteractionController
<key>UISupportsDocumentBrowser</key>
<true/>
//if not use -
<key>LSSupportsOpeningDocumentsInPlace</key>
<true/>
From the Apple Developer Documentation
来自 Apple 开发者文档
UISupportsDocumentBrowser
UISupportsDocumentBrowser (Boolean - iOS) Specifies that the app is a document-based app and uses the UIDocumentBrowserViewController class.
UISupportsDocumentBrowser (Boolean - iOS) 指定应用程序是基于文档的应用程序并使用 UIDocumentBrowserViewController 类。
If this key is set to YES, the user can set the document browser's default save location in Settings. Additionally, the local file provider grants access to all the documents in the app's Documents directory. These documents appear in the Files app, and in a Document Browser. Users can open and edit these document in place.
如果此键设置为 YES,用户可以在设置中设置文档浏览器的默认保存位置。此外,本地文件提供程序授予对应用程序文档目录中所有文档的访问权限。这些文档显示在“文件”应用程序和文档浏览器中。用户可以就地打开和编辑这些文档。
This key is supported in iOS 11 and later.
iOS 11 及更高版本支持此密钥。
UIDocumentInteractionController
Use this class to present an appropriate user interface for previewing, opening, copying, or printing a specified file. For example, an email program might use this class to allow the user to preview attachments and open them in other apps. After presenting its user interface, a document interaction controller handles all interactions needed to support file preview and menu display. You can also use the delegate to participate in interactions occurring within the presented interface. For example, the delegate is notified when a file is about to be handed off to another application for opening. For a complete description of the methods you can implement in your delegate, see UIDocumentInteractionControllerDelegate.
使用此类可提供适当的用户界面,用于预览、打开、复制或打印指定文件。例如,电子邮件程序可能会使用此类来允许用户预览附件并在其他应用程序中打开它们。在呈现其用户界面后,文档交互控制器处理支持文件预览和菜单显示所需的所有交互。您还可以使用委托参与呈现的界面中发生的交互。例如,当文件即将移交给另一个应用程序打开时,会通知委托人。有关可以在委托中实现的方法的完整说明,请参阅 UIDocumentInteractionControllerDelegate。
LSSupportsOpeningDocumentsInPlace
LSSupportsOpeningDocumentsInPlace (Boolean - iOS) When set to a value of YES, enables your app to open the original document from a file provider, rather than a copy of the document. The app can access documents from the system's local file provider, the iCloud file provider, and any third-party File Provider extensions that support opening documents in place.
LSSupportsOpeningDocumentsInPlace(布尔值 - iOS)当设置为 YES 值时,使您的应用程序能够从文件提供程序打开原始文档,而不是文档的副本。该应用程序可以从系统的本地文件提供程序、iCloud 文件提供程序和任何支持打开文件的第三方文件提供程序扩展访问文件。
The URL for a document opened in place is security-scoped. For information about working with security-scoped URLs and bookmarks, read the overview in NSURL Class Reference and read Document Provider in App Extension Programming Guide.
就地打开的文档的 URL 是安全范围的。有关使用安全范围的 URL 和书签的信息,请阅读 NSURL 类参考中的概述并阅读 App 扩展编程指南中的文档提供者。
Important: When opening a document in place, other processes can modify the document at any time. Therefore, you must coordinate your access to the document using either a UIDocument subclass or NSFilePresenter and NSFileCoordinator objects. In iOS 11 and later, if both this key and the UIFileSharingEnabled key are YES, the local file provider grants access to all the documents in the app's Documents directory. These documents appear in the Files app, and in a document browser. Users can open and edit these document in place.
重要:在原地打开文档时,其他进程可以随时修改文档。因此,您必须使用 UIDocument 子类或 NSFilePresenter 和 NSFileCoordinator 对象来协调对文档的访问。在 iOS 11 及更高版本中,如果此键和 UIFileSharingEnabled 键都为 YES,则本地文件提供程序授予对应用程序 Documents 目录中所有文档的访问权限。这些文档显示在“文件”应用程序和文档浏览器中。用户可以就地打开和编辑这些文档。
Setting Up a Document Browser AppLink
设置文档浏览器应用程序链接