69

I have submitted a Single View Swift iOS application to App Store Connect. The application is not Document Based.

The application uploads successfully, but I get the following warning in an email from Apple. I can still test the application through Test Flight, but I want to eliminate the warning.

"Invalid Document Configuration - Document Based Apps should support either the Document Browser (UISupportsDocumentBrowser = YES) or implement Open In Place (LSSupportsOpeningDocumentsInPlace = YES/NO)."

11
  • 1
    @rmaddy I'm not targeting iOS 12. Would that make a difference? In the Document Types section under "Info" it says there are 0 document types. Sep 7, 2018 at 18:16
  • Hmm. I certainly could be wrong. I had assume that because I saw a similar warning in Xcode 10 the other day the first time I built an app previously made with Xcode 9. But now I'm not seeing that message.
    – rmaddy
    Sep 7, 2018 at 18:21
  • Okay, thanks. The app works fine, I would just like to knock out the warning :) Sep 7, 2018 at 18:22
  • 2
    i saw this issue today as well. something is up at build processing step. we have not implemented UIDocuments at all.
    – subodh1989
    Sep 7, 2018 at 18:23
  • 1
    got this warning last night too for first time Sep 7, 2018 at 18:39

7 Answers 7

33

I just ran into the same problem; I don't know why, since I barely change anything since the previous version of my app.

Anyway, my app doesn't support the Document Browser, so the first half of the error message doesn't apply. That left me with the second half. I looked up LSSupportsOpeningDocumentsInPlace's documentation and still wasn't clear on how it works, so I decided to try both options. My app supports it's own document type, and when a user opens an appropriate file iOS shows an action sheet with the option "Copy to Leio" (my app). After setting LSSupportsOpeningDocumentsInPlace to YES, iOS wouldn't show that action sheet anymore; it would just open my app and do nothing. So I set it to NO; now the app works as it did before and I'm not getting that error message anymore. If you don't handle any document types I suppose you could set the option either way.


Edit: There's some more information about that option here.

So there you go. If your app were to edit a document, would it edit the original document, or would it make a copy and deal with that? Set the option accordingly. If you really don't do anything like that I'd guess setting the option to NO would be the safest bet, and I think that's how my app behaved when I hadn't set that option at all.

5
  • when i don't mention either LSSupportsOpeningDocumentsInPlace or UISupportsDocumentBrowser and have mentioned in Document Types(like png, pdf etc) the share action sheet in another app shows "copy to MyApp", whereas when i set LSSupportsOpeningDocumentsInPlace to YES, the actions sheet shows "Open in MyApp" when MyApp is opened> in open url method, the url is pointing to the document instead of the copy of the document and unable to access the same.
    – Rajesh Rs
    Sep 10, 2018 at 4:58
  • @RajeshRs That’s weird… definitely not how it goes for me. 🤷🏻‍♂️
    – dbmrq
    Sep 10, 2018 at 5:20
  • @RajeshRs Oh, you're right actually, I wrote it the wrong way around, I meant to say that setting the option to NO results in "copy to MyApp"!
    – dbmrq
    Sep 11, 2018 at 1:19
  • LSSupportsOpeningDocumentsInPlace=YES and my app hangs at splash screen when opening email attatchment in my app. LSSupportsOpeningDocumentsInPlace=NO and all is good again! Thanks! Sep 14, 2018 at 21:52
  • 1
    This answer is basically correct. Important things to note: - if you're handing documents, you'll want to set LSSupportsOpeningDocumentsInPlace to YES, but you have to actually support it: you need to /not/ treat the file as a copy (ie. not delete it when you're done with it!) - if LSSupportsOpeningDocumentsInPlace is YES, you will get URLs for documents that are security-scoped. Watch the WWDC session about building document-based apps. - if you're not handling documents, just remove the empty CFBundleDocumentTypes key.
    – jfortmann
    Feb 8, 2019 at 19:33
14

Since your app is not Document based just set UISupportsDocumentBrowser and/or LSSupportsOpeningDocumentsInPlace (reference and documentation) to NO in your plist. This should resolve the warning.

I had the same problem with the warning from App Store Connect. After changes these two keys to NO and resubmitting the warning was gone.

1
  • 2
    Thanks for the response. My app supports Document copy so I could fix the warning by adding below two things in Info.plist <key>UISupportsDocumentBrowser</key> <true/> <key>LSSupportsOpeningDocumentsInPlace</key> <true/>
    – Abhilasha
    Sep 11, 2018 at 7:22
13

Typical Requirement

If your application is not document based (which would typically be the case if you get this new warning) and if furthermore you are already opening files in your documents directory, then all you need is:

LSSupportsOpeningDocumentsInPlace = YES

Supports opening documents in place


This answer does not apply if you are not opening documents in place (i.e. make a copy), or of course, if you so desire to support document browser, as seen in @rivera's comment.

3
  • 1
    I don't think this answer is correct at all. See LSSupportsOpeningDocumentsInPlace. This setting (YES or NO) should be added to an app when the app opens files from other apps. And setting it to YES requires special handling of the file (see the link).
    – rmaddy
    Oct 4, 2018 at 3:26
  • @rmaddy: In your opinion, what's the correct fix when an app doesn't support the Document Browser? Surely UISupportsDocumentBrowser = YES cannot be the correct route, or is it? Oct 12, 2018 at 7:09
  • In my own app that does not support document browser but it does support opening files from other apps (such as email attachments, etc.), I just added LSSupportsOpeningDocumentsInPlace with a value of NO. My issue with the wording of your answer is that you imply LSSupportsOpeningDocumentsInPlace has do with an app using its own Documents folder. That's not true. It has to do with your app being launched to open/copy a file from another app.
    – rmaddy
    Oct 12, 2018 at 14:02
8

If you are using UIDocumentInteractionController in your app, set

UISupportsDocumentBrowser = YES

in your project's info.plist; otherwise, set

UISupportsDocumentBrowser = NO
2
  • Thank you :) Pang Nov 16, 2018 at 10:38
  • I have same problem, and solved as "UISupportsDocumentBrowser = YES"
    – dobiho
    Apr 24, 2019 at 9:31
3

It appears that if you have CFBundleDocumentTypes in your apps Info.plist, even if the array is empty, this warning is triggered when you submit your app. If your app doesn't support any document types remove that key and you won't get the warning.

1

Here are where you find the settings in Xcode 13:

Finding key in plist

Setting key in plist

0

I also faced the same issue recently while uploading the app to TestFlight, The below solution worked for me,

In your app's Info.plist file, the UISupportsDocumentBrowser key is set to YES, declaring document browser support for your app.

For more info, please refer Setting Up a Document Browser App

4
  • 5
    But I don’t want to have a Document Base app. Unless I’m misreading your answer. Sep 7, 2018 at 19:07
  • I understand I am also not using the Document based app, but few documents are shown in my app, and suddenly TestFlight uploading started throwing this error today
    – Bappaditya
    Sep 7, 2018 at 19:09
  • 2
    I really don't want to set this flag: "In your app's Info.plist file, the UISupportsDocumentBrowser key is set to YES, declaring document browser support for your app. Specifically, this key lets other apps open and edit the files stored in your app’s Documents directory. It also lets users set the app’s default save location in Settings."
    – Rivera
    Sep 7, 2018 at 21:35
  • @Rivera you can remove CFBundleDocumentTypes from the Info.plist to suppress this error.
    – alfwatt
    Sep 14, 2018 at 22:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.