Can a SwiftUI document based app show Firestore documents in the SwiftUI document browser directly?

227 Views Asked by At

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?

1

There are 1 best solutions below

2
On

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?