Hi all,
I’m building an iOS app where I need to determine user picked files or folders using UIDocumentPickerViewController, whether the selected item is synced or managed by a cloud storage provider such as:
- Google Drive
- iCloud Drive
- OneDrive
- Dropbox
- or any third-party File Provider extension
My intent is to detect this and optionally warn the user that the item may be subject to syncing behavior.
So far, I’ve tried a few different approaches:
-
Extended Attributes (listxattr / getxattr) While this does not give reliable outcome.
-
Heuristically search for keywords like 'Drive', 'GoogleDrive' etc But this is also not reliable.
Question
Is there any possible reliable and documented way to detect programmatically if a file/folder is cloud-synced or managed by a File Provider from within a regular iOS app (not an extension), especially for:
- Google Drive
- OneDrive
- Dropbox
- iCloud
- Other third-party providers?
Also, is there any recommended fallback strategy for iOS versions prior to 17 where NSFileProviderManager
may have limitations?
Any input from Apple engineers or those who have tackled this would be hugely appreciated!
Thanks in advance 🙌