iCloud Drive

RSS for tag

iCloud Drive safely stores any kind of file so it can be accessed in iCloud-enabled apps on iPhone, iPad, Mac, or PC.

Posts under iCloud Drive tag

54 Posts
Sort by:

Post

Replies

Boosts

Views

Activity

Unable to login to iCloud on Simulator (to test SwiftData sync)
Xcode 15.2. Brand new simulator set up, running 17.2. Brand new AppleID, and have logged in and accepted terms. Totally unable to login to iCloud on the Simulator to test iCloud syncing. There are numerous threads dating back 6 years plus of people having issues logging in to iCloud on the Simulator. Seems like it's still an issue. I have tried every solution. Existing AppleID. New AppleID. Logged into iCloud on Safari on Desktop and Simulator to check for unaccepted terms. Still get the commonly reported Sign-in page sitting spinning endlessly. Checked Console for errors and only things that seem possibly related are: com.apple.shortcuts CloudKitSync info 13:41:04.506714+0000 siriactionsd -[VCCKShortcutSyncCoordinator updateAccountStatusAndUserRecordID]_block_invoke Not fetching current user record ID because iCloud account is not available Is it really still the case that logging in to iCloud on a Simulator, to test sign on or iCloud sync is still horribly broken, and has been for over 6 years?
2
1
633
Jun ’24
iCloud Drive
/var/mobile/Containers/Data/Application/9DBD5CCD-36A9-4496-93FB-B8EBD679E934/Documents/godai_2024-01-16_09-34-11-445/photo_2024-01-16_09-34-11-452.json..in this debug console folder name "godai_2024-01-16_09-34-11-445" is shown but in iCloud Drive folder name change into example ..how can to fix this issue ??
0
0
384
Jan ’24
Access file from File app works inside my application, but doesn't work if I launch my app from the File app
Hi! I've got an application that can handle json (export/import). To achieve that I created a new Document Type in the info.plist, filed the imported and exported Type Identifiers, and created a new UTType. At first I was trying on the simulator and everything worked fine. I was able to created files and store them in the File app, and then read them back. I also implemented the func scene(_ scene: UIScene, openURLContexts URLContexts: Set<UIOpenURLContext>) to handle documents opened from outside the application. Now when I moved on onto a real device, I noticed that I had to test the access with guard url.startAccessingSecurityScopedResource() else { throw ImportError.accessDenied } defer { url.stopAccessingSecurityScopedResource() } but I get a weird behavior : when opening a file from File app with my app launched, everything works fine. But if I try to launch my application (previously killed) from a file in the File app, startAccessingSecurityScopedResource always returns false I tried to add the NSFileCoordinator().coordinate(readingItemAt: url, error: &error) { (url) in but I get the same behavior. I guess my files and UTType are correctly declared as I only see them from inside the `UIDocumentPickerViewController`` and from the File app, I see my application in the share sheet What am I missing here ? Thanks
1
0
1.4k
Jan ’24
UIDocumentPickerViewController with type .folder won't give access to files inside selected folder
Hi, I followed the instructions here: https://developer.apple.com/documentation/uikit/view_controllers/providing_access_to_directories but when trying to get access to each file inside the selected folder (tried iCloud and iPhone) it always fails. Instead, if I specify a type of file on the Controller (say .audio) I can read the file fine... Did anything change which is not documented in that page? Do I have to set any other permission or capability? (I have iCloud Documents) Thanks!!
2
0
705
Dec ’23
Download and upload
Hi I'm confused. Today my icloud drive folder started downloading files to my macbook. These files were stored in the cloud. There was a cloud icon with a down arrow next to them. Now over 11 gigabytes of files have now downloaded from the cloud. The icon is gone. Consequently, they have been uploaded to the macbook. How do I get them back into the cloud ? I'm confused about the actions and icons.
0
0
439
Nov ’23
GameKit - iCloud Sign In Error
Hi everyone, I'm trying to implement matchmaking in visionOS using GameKit and GameCenter. I'm following the example project that been shared but I get an error. Error: The requested operation could not be completed because you are not signed in to iCloud.. I'm getting this error as a result of matchmaking. I'm already logged in to iCloud in Vision Pro Simulator. I've tried to switch off-on every related settings but didn't work. I'm using latest Xcode Dev Beta and visionOS Beta v6. Would you mind share me any workaround? Regards, Melih
3
0
1.1k
Jan ’24
startAccessingSecurityScopedResource always returns false for files in iCloud Drive folder
Hello, I am trying to use the SwiftUI fileImporter to get the URL of a direcotry and access it for the files in it. If I follow the document( Access the directory’s content ) and use url.startAccessingSecurityScopedResource for each file, it always returns false. but this seems to be different from the documentation. If the current behavior is correct, will the documentation be updated in the future? Related: Access all files in UIDocumentPick… | Apple Developer Forums I asked this question because I am concerned that if I remove the standardAccessingSecurityScopedResource to match the current situation, the standardAccessingSecurityScopedResource may become necessary due to future iOS updates. Also, is there any way to know if the status of the AccessingSecurityScopedResource? It would be helpful if we could callstartAcesingSecurityScopedResource only when needed. Thanks Here is a sample code @main struct SampleApp: App { var body: some Scene { WindowGroup { ContentView() } } } struct ContentView: View { @State private var isShowingImportFolder = false @State private var isShowingImportFile = false var body: some View { VStack(spacing: 48) { Button("Read Folder") { isShowingImportFolder = true } .fileImporter(isPresented: $isShowingImportFolder, allowedContentTypes: [.folder]) { result in switch result { case .success(let url): processDirectory(url) case .failure(let error): print("failed. error: \(error)") } } Button("Read File") { isShowingImportFile = true } .fileImporter(isPresented: $isShowingImportFile, allowedContentTypes: [.data]) { result in switch result { case .success(let url): readFile(url) case .failure(let error): print("failed. error: \(error)") } } } } private func processDirectory(_ directory: URL) { guard directory.startAccessingSecurityScopedResource() else { fatalError("failed. directory.startAccessingSecurityScopedResource") } defer { directory.stopAccessingSecurityScopedResource() } var error: NSError? NSFileCoordinator().coordinate(readingItemAt: directory, error: &error) { url in let urls = try! FileManager.default.contentsOfDirectory(at: url, includingPropertiesForKeys: [.nameKey, .isDirectoryKey]) urls.lazy .filter { !$0.hasDirectoryPath } .forEach { readFile($0) } } } private func readFile(_ url: URL) { guard url.startAccessingSecurityScopedResource() else { print("failed access. \(url.path)") return } defer { url.stopAccessingSecurityScopedResource() } let data = try! Data(contentsOf: url) print("file.path: \(url.path()), size: \(data.count)") // read file... } }
1
0
1.1k
Mar ’24
FIFinderSync not working in iCloud Drive on Sonoma
When setting up a Finder Sync Extension, even when just using the minimal template given by the File → New → Target → macOS ones provided in Xcode, the right-click menu does not show up within iCloud Drive, while toolbar buttons always work. Outside iCloud Drive multiple extensions show up when right-clicking on Finder's background. When right-clicking inside iCloud Drive (here my synced Desktop folder), they do not show up. Before macOS Sonoma this worked perfectly for me, but it broke beginning with the first beta. No Finder extension from any app (such as the Keka one) work anymore. I have seen it discussed that not more than one Finder extension can be active in a directory, but that is not true as can be seen in the first screenshot. Q: How can I circumvent this issue?
3
0
1k
Jun ’24
iPadOS17.8 beta not syncing our app
We use a test iPad to test new versions of our app as well as checking new (beta) versions of iPadOS. Our app - Rendezvous Appointment Book -uses iCloud to sync between the iPad and iPhone. So, when an entry is made on either the iPad or iPhone the entry is automatically synced to the other device(s). So, a user can make a client appointment on one device and it syncs to another iPad or iPhone logged into the same iCloud account. This has worked smoothly for years. But, the latest beta version - 17.8 caused a syncing issue where all the existing data that is stored on the same iCloud account did not sync. We have seen this before. Recently, starting with iPadOS/iOS 16.3 syncing failed for a number of users just on their iPads. The data stored on iCloud disappeared, but the iPhone did sync with iCloud. About 30 users could not get their data to sync at all , but the vast majority did sync. Some users who experienced the problem were able to sync by deleting the app and reinstalling it from the App Store, as per our recovery instructions. Then when version 16.4 was released all syncing worked as well as 16.5 and 16.6 which have worked perfectly. When 17 beta was released we tested again for proper syncing, but ran into the same issue with version 17.3 beta - no sync again. But 17.6 beta did sync. Now, in testing this last Thursday with 17.8 beta the same issue reappeared on our test iPad. We contacted Apple Developer support but have yet to get any resolution (and we are worried that when Apple releases 17 on Sep 11 the syncing issue might still rear its ugly head). Has anyone seen this happen? BTW all other iCloud syncing worked correctly, e.g. Photos, backups, etc.
2
1
1k
Jan ’24
Querying imported files and folders on iOS using NSMetadataQuery
Hi all, I’m trying to use NSMetadataQuery on iOS to track changes to folders users have imported from elsewhere but, no matter what I try, I get no results. Following the documentation for searching file metadata with NSMetadataQuery, I’m creating a live query (albeit in Swift) and listening for […]QueryDidFinishGathering and […]QueryDidUpdate. The former fires, with no results, and the latter never fires. I’ve also tried following the Synchronizing Documents in the iCloud Environment example, adding the appropriate Ubiquity keys to my Info.plist and .entitlements file, with no change. I’m importing files and folders using SwiftUI’s View.fileImporter(isPresented:allowedContentTypes:allowsMultipleSelection:onCompletion:), but can’t see how I might security-scope the NSMetadataQuery’s execution (if that’s even a thing?). My test project is on GitHub, but the main parts are below… My query method: extension NSMetadataQueryUbiquitousExternalDocumentsTestApp { func findAccessibleFiles() { query.stop() fileMonitor?.cancel() fileMonitor = Publishers.MergeMany( [ .NSMetadataQueryDidFinishGathering, .NSMetadataQueryDidUpdate ].map { NotificationCenter.default.publisher(for: $0) } ) .receive(on: DispatchQueue.main) .sink { notification in query.disableUpdates() defer { query.enableUpdates() } foundItems = query.results as! [NSMetadataItem] print("Query posted \(notification.name.rawValue) with results: \(query.results)") } query.searchScopes = [ NSMetadataQueryAccessibleUbiquitousExternalDocumentsScope ] query.predicate = NSPredicate( format: "%K LIKE %@", argumentArray: [NSMetadataItemFSNameKey, "*"] ) query.sortDescriptors = [ NSSortDescriptor(key: NSMetadataItemFSNameKey, ascending: true) ] if query.start() { print("Query started") } else { print("Query didn't start for some reason") } } } Info.plist: […] <key>NSUbiquitousContainers</key> <dict> <key>iCloud.com.stevemarshall.AnnotateML</key> <dict> <key>NSUbiquitousContainerIsDocumentScopePublic</key> <true/> <key>NSUbiquitousContainerName</key> <string>AnnotateML</string> <key>NSUbiquitousContainerSupportedFolderLevels</key> <string>ANY</string> </dict> </dict> […]
3
0
2k
Jul ’24