警告的详细信息:
WARN: WARNING ITMS-90737: "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."
修改方式有两种:
1.info.plist中添加LSSupportsOpeningDocumentsInPlace设置项
LSSupportsOpeningDocumentsInPlace为YES:在ios11及以上的系统,在Files App中会看到当前应用Documents目录
当前应用需要实现UIApplication的下面的方法,在从Files App点击文件后,会调用该方法然后进行后续的处理。
- (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary *)options
LSSupportsOpeningDocumentsInPlace为NO:在ios11及以上的系统,在Files App中会不看到当前应用Documents目录,和info.plist里没有LSSupportsOpeningDocumentsInPlace效果相同
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.
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.
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.
2.如果应用使用UIDocumentInteractionController来打开文件,info.plist中将UISupportsDocumentBrowser设置为YES
UISupportsDocumentBrowser官方解释
UISupportsDocumentBrowser (Boolean - iOS) Specifies that the app is a document-based app and uses the UIDocumentBrowserViewController class.
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.
This key is supported in iOS 11 and later.