0

Using Swift 5.3.1, Xcode 12.2, iOS 14.2.

Is it possible to directly access Firestore documents from within a DocumentGroup based iOS app?

I know that you can show the document browser with iOS 14 and SwiftUI. And it is also able to show iCloud or custom cloud documents.

But I wonder if Firestore can be the external cloud for your custom-typed document picker in iOS?

If yes, how?

Peter Friese
  • 6,709
  • 31
  • 43
iKK
  • 6,394
  • 10
  • 58
  • 131

1 Answers1

2

The short answer is no.

Cloud Firestore is a document-based NoSQL database in the cloud, and it is intended to be used by developers to build their own apps. A document in Cloud Firestore refers to a unit of information that is meaningful in the context of an application. It is not to be confused with a document in the sense of a container for data on your file system or in iCloud. In this sense, it is much more similar to CloudKit.

That being said, you would definitely be able to implement a File Provider that uses Cloud Firestore to store present your application's data in a representation that is meaningful to iOS apps that consume files. However, it might be more useful to use Cloud Storage as the backend for this kind of app.

I'd be curious about your use case - can you elaborate a bit more what you're aiming to achieve?

Peter Friese
  • 6,709
  • 31
  • 43
  • Thank you Peter, for your explanations. Indeed, we use Firestore AND Firebase/Storage. We use Firestore for our Media-collection as well as references to other relevant Firestore-collections related to the Media (to keep query-times short as NoSQL best practices). In addition, this Firestore-Media-collection holds a path-field for the corresponding Firebase/Storage image or video. This path-field in the Firestore Media-collection is then used if a Firestore-query leads to Media-results that, for example, need to be downloaded (or potentially shown in the Document-Picker in the first place). – iKK Nov 14 '20 at 12:20
  • Therefore, I do not intend to open-up the App Document-Picker for all Firebase/Storage images and videos at once - but I would much rather open up the App Document-Picker for queried Firestore Media-results that then are shown to be picked by the user. Does this make sense ? Is there another architecture that you would suggest to allow the Document-Picker being limited to a subset of Media from the Firebase/Storage bucket to be in-line with a query-result subset ? – iKK Nov 14 '20 at 12:22