CloudKit Console

RSS for tag

Monitor and manage the CloudKit database containers used by your apps.

Posts under CloudKit Console tag

39 Posts
Sort by:

Post

Replies

Boosts

Views

Activity

Why is CKModifyRecordsOperation to batch delete records in CloudKit not deleting records?
My Code: let op = CKModifyRecordsOperation(recordIDsToDelete:recordIDsToDelete) op.modifyRecordsCompletionBlock = { _, deleteRecordIDs, error in if error == nil { print("successful delete deleteRecordIDS = \(deleteRecordIDs)") } else { print("delete error = \(error?.localizedDescription)") } } op.database = CKContainer.default().privateCloudDatabase op.qualityOfService = .userInitiated CKContainer.default().privateCloudDatabase.add(op) My problem is that CKRecord are not deleted once I reinstall the app: when I reinstall the app and try to delete a CloudKit record, the method is executed successfully (error is nil) but the records are still in CloudKit Dashboards.
1
0
100
21h
CloudKit console fails to query indexed records in Production
"No records found" If I create a new record on the console, I can copy the record name. I can then query for recordName and get that individual record back. BUT no other queries work. I cannot query all records. I cannot query by individual property. Just returns "no records found" Seems like my indexes got messed up. Is there a way to reset indexes on prod? This is on a coredata.cloudkit managed zone.
1
0
58
1d
CloudKit it writes to development container, not Production
I have an app that I signed and distribute between some internal testflight users. Potentially I want to invite some 'Public' beta testers which don't need to validate (_World have read rights in the public database) Question: Do I need to have a working public CloudKit , when users are invited through TestFlight, or are they going to test on the development container? I understand that when I invite beta-tester without authorization (external testers) they cannot access the developer container, so therefore I need to have the production CloudKit container up and running. I have tried to populate the public production container, but for whatever reason my upload app still goes to the development container. I have archived the app, and tried, but no luck. I let xcode manage my certificates/profiles. but what do I need to change to be able to use my upload file to upload the production container, instead of the development. I tried: init() { container = CKContainer(identifier: "iCloud.com.xxxx.xxxx") publicDB = container.publicCloudDatabase I got no error in the console, but data is always populated to the development database, instead the production. I tried to create a provisioning profile, but for some reason Xcode doesn't like it. Tried to create one a different provisioning profile manual through the developer portal, for the app. but xcode doesn't want to use that, and mentions that the requirement are already in place. What can I check/do to solve this.
1
0
59
2w
CloudKit: Records not indexing
Since publishing new record types to my CloudKit schema in production, a previously unchanged record type has stopped indexing new records. While records of this type are successfully saved without errors, they are not returned in query results—they can only be accessed directly via their recordName. This issue occurs exclusively in the Production environment, both in the CloudKit Console and our iOS app. The problem began on July 21, 2025, and continues to persist. The issue affects only new records of this specific record type; all other types are indexing and querying as expected. The affected record's fields are properly configured with the appropriate index types (e.g., QUERYABLE) and have been not been modified prior to publishing the schema. With this, are there any steps I should take to restore indexing functionality for this record type in Production? There have been new records inserted, and I would prefer to not have to reset the production database, if possible.
4
1
153
1d
Adding new iCloud Container when we have already one
My app is live on App Store, There is already a iCloudContainer with my app identifier. I want to add another iCloundContainer on same app identifier. Will it effect my live app? When I am trying to edit identifiers(adding a new iCloud Container with other one already exist), It is showing "Adding or removing any capabilities will invalidate any provisioning profiles that include this App ID and they must be regenerated for future use." Please let me know if it effect my live application...
1
0
102
Jul ’25
Invalid bundle ID for container
Hi. I am having this error when trying to write to CloudKit public database. <CKError 0x600000dbc4e0: "Permission Failure" (10/2007); server message = "Invalid bundle ID for container"; On app launch, I check for account status and ensure that the correct bundle identifier and container is being used. When the account status is checked, I do get the correct bundle id and container id printed in the console but trying to read or write to the container would throw that "Invalid bundle ID for container" error. private init() { container = CKContainer.default() publicDB = container.publicCloudDatabase // Check iCloud account status checkAccountStatus() } func checkAccountStatus() { print("🔍 CloudKit Debug:") print("🔍 Bundle identifier from app: (Bundle.main.bundleIdentifier ?? "unknown")") print("🔍 Container identifier: (container.containerIdentifier ?? "unknown")") container.accountStatus { [weak self] status, error in DispatchQueue.main.async { switch status { case .available: self?.isSignedIn = true self?.fetchUserID() case .noAccount, .restricted, .couldNotDetermine: self?.isSignedIn = false self?.errorMessage = "Please sign in to iCloud in Settings to use this app." default: self?.isSignedIn = false self?.errorMessage = "Unknown iCloud account status." } print("User is signed into iCloud: \(self?.isSignedIn ?? false)") print("Account status: \(status.rawValue)") } } } I have tried: Creating a new container Unselecting and selecting the container in signing & capabilities Unselecting and selecting the container in App ID Configuration I used to have swift data models in my code and read that swift data is not compatible with CloudKit public data so I removed all the models and any swift data codes and only uses CloudKit public database. let savedRecord = try await publicDB.save(record) Nothing seems to work. If anyone could help please? Rgds, Hans
1
0
140
Jun ’25
CloudKit Console: No Containers
Background: Our non-production App was using SwiftData locally. Yesterday we followed the documentation to enable CloudKit: https://developer.apple.com/documentation/cloudkit/enabling-cloudkit-in-your-app iCloud Works: Data is properly syncing via iCloud between 2 devices. Add on one shows on the other; delete on one deletes on the other. Today we logged into CloudKit Console for the first time; but there are no databases showing. We verified: Users and Roles: we have “Access to Cloud Managed… Certificates” Certificates, Identifiers & Profiles: our app has iCloud capabilities and is using our iCloud Container Signed into CloudKit Console with same developer ID as AppStoreConnect This is also the Apple ID of the iCloud account that has synced data from our app. In Xcode > Signing & Capabilities we are signed in as our Company team. Any guidance or tips to understanding how to what’s going on in CloudKit Console and gaining access to the database is appreciated!
1
0
100
Jun ’25
cloudkit server-to-server key confusion
Hi I am a new self taught developer who is atm working on the backend of my app. My app successfully collects location of users and stores it to cloudkits public database. I now want to write a python script and run it on a local server on my windows terminal which fetches users who are in a certain proximity to each other so i can trigger a flow on the app. Can someone first of all tell me if this is even possible the way im attempting it. Also atm all i am doing is generating a server to server key which makes me generate a public and private key and i use the private key file eckey.pem plus key id plus container plus team ID to query the required data. but when i run it i get a 401 error (no authorization). I am so stumped as there arent many resources available to help direct me to the right path. Can someone please offer some help/insight/confidence. thanks alot
0
0
56
May ’25
Login issues on CloudKit Console
Hi everyone In the last 24 hours, I’ve been running into some issues with the CloudKit console. Most of the time, I‘ll get an error stating an error has caused this web page to stop working correctly. Reloading doesn’t fix the issue, nor does using different browsers: Today I’ve got another error, something along the lines of the Console not being able to fetch the teams I’m assigned to and an XHF error pop-up. Has anyone encountered the same issues? After trying multiple times, I’m able to reach my database but it’s a bit frustrating as it’s very unreliable this way. Thanks for your feedback! Dave
1
3
55
May ’25
Safe way to query for the existence of a CKRecordZone?
There's some logic in my app that first checks to see if a specific CloudKit record zone exists. If it doesn't, it creates the zone, and then my application continues on with its work. The way I've implemented this right now is by catching the zoneNotFound error when I call CKDatabase#recordZone(for:) (docs) and creating the zone when that happens: do { try await db.recordZone(for: zoneID) } catch let ckError as CKError where [.zoneNotFound, .userDeletedZone].contains(ckError.code) { // createZone is a helper function try await createZone(zoneID: zoneID, context: context) } This works great, but every time I do this, an error is logged in CloudKit Console, which creates a lot of noise and makes it harder to see real errors. Is there a way to do this without explicitly triggering a CloudKit error? I just found CKDatabase#recordZones(for:) (docs), which seems like it returns an empty array instead of throwing an error if the zone doesn't exist. Will calling that and looking for a non-empty array work just as well, but without logging lots of errors in the console?
1
0
55
Apr ’25
Data Transfer or Upload to Cloudkit in Published Mode
So i created an App and for some time it was working fine. The app has features to show pdf to users without logging in. I needed to upload all data to cloudkit on public database. I was not having knowledge that there are 2 mode being a noob in coding so after i saved all records in development mode in cloudkit when i published my app, i was not able to see them (Reason because live mode works in Production mode). So i need help now to transfer data from development mode to production mode or any app or code that can help me upload all data in production mode.
1
0
70
Mar ’25
Critical: Cannot Deploy CloudKit Schema to Production Environment - Internal Error
Hi Developer Community, I'm experiencing a critical issue with CloudKit schema deployment that's blocking my app release. I've been trying to resolve this for several days and would appreciate any assistance from the community or Apple engineers. Issue Description I'm unable to deploy my CloudKit schema from development to production environment. When attempting to deploy through the CloudKit Dashboard, I either get an "Internal Error" message or the deployment button is disabled. Environment Details App: Reef Trak (Reef aquarium tracking app) CloudKit Container: ************ Development Environment: Schema fully defined and working correctly Production Environment: No schema deployed (confirmed in dashboard) What I've Tried Using the "Deploy Schema to Production" button in CloudKit Dashboard (results in "Internal Error") Exporting schema from development and importing to production (fails) Using CloudKit CLI tools with API token (results in "invalid-scope" errors) Waiting 24-48 hours between attempts in case of propagation delays Current Status App works perfectly in development environment (when run from Xcode) In TestFlight/sideloaded builds (production environment), the app attempts to fetch records but fails with "Did not find record type: Tank" errors Log snippet showing the issue: [2025-03-21] [CloudKit] Schema creation failed: Error saving record <CKRecordID: 0x******; recordName=SchemaSetup_Tank_-**---****, zoneID=_defaultZone:defaultOwner> to server: Cannot create new type Tank in production schema [2025-03-21] [CloudKit] Failed to create schema for Tank after 3 attempts [2025-03-21] [CloudKit] Error creating schema for Tank: Error saving record <CKRecordID: 0x****; recordName=SchemaSetup_Tank_---**-**********, zoneID=_defaultZone:defaultOwner> to server: Cannot create new type Tank in production schema App Architecture & Critical Impact My app "Reef Trak" is built around a core data model where the "Tank" entity serves as the foundational element of the entire application architecture. The Tank entity is not just another data type - it's the primary container that establishes the hierarchical relationship for all other entities: All parameter measurements (pH, temperature, salinity, etc.) are associated with specific tanks All maintenance tasks and schedules are tank-specific All livestock (fish, corals, invertebrates) exist within the context of a tank All user achievements and progress tracking depend on tank-related activities Without the Tank schema being properly deployed to production, users experience what appears to be a completely empty application, despite successful authentication and CloudKit connection. The app shows "Successfully retrieved iCloud data" but displays no content because: The Tank record type doesn't exist in production Without Tanks, all child entities (even if their schemas existed) have no parent to associate with This creates a cascading failure where no data can be displayed or saved This issue effectively renders the entire application non-functional in production, despite working flawlessly in development. Users are left with an empty shell of an app that cannot fulfill its core purpose of reef tank management and monitoring. The inability to deploy the Tank schema to production is therefore not just a minor inconvenience but a complete blocker for the app's release and functionality. Questions Is there an alternative method to deploy schema to production that I'm missing? Could there be an issue with my account permissions or container configuration? Are there known issues with the CloudKit Dashboard deployment functionality? What's the recommended approach when the dashboard deployment fails? I've also submitted a Technical Support Incident, but I'm hoping to get this resolved quickly as it's blocking my App Store release. Thank you for any assistance!
3
0
122
Mar ’25
CloudKit - Friend request / connection
I implemented the cloudkit function, where users can connect with each other. The problem is, that if User A is doing a friend request and User B is accepting the request. The friend entry is correct visible for User B but not for User A. I can see in cloud kit that after the accepted request, the friend connection is set up correctly, also with the correct userID, but it not showing up for User A (the one that send the request) It's in the public database. In this view you sign in using Apple Sign-In and create a specific user ID. Then you can access a global leaderboard to compare with all signed-in users. Additionaly, there’s a friend tab where you can search for and type in a specific user ID. The target user sees the friend request, can accept it, and then the accepted friend appears in their friend list. However, the original requester doesn’t see the connection after acceptance even though CloudKit shows the records Add comment. I've also tried to add a placeholder in for User A, that e.g he send the request and then has a placeholder where it says e.g pending request to User B. After User B accepted the request, the placeholder will go away and no friend connection is displayed, very strange.
1
0
177
Mar ’25
Friend Connection ( User A / User B) Problem
I implemented the cloudkit function, where users can connect with each other. The problem is, that if User A is doing a friend request and User B is accepting the request. The friend entry is correct visible for User B but not for User A. I can see in cloud kit that after the accepted request, the friend connection is set up correctly, also with the correct userID, but it not showing up for User A (the one that send the request)
3
0
370
Mar ’25
CloudKit CKModifyRecordsOperation resulting in undocumented error "Internal Error" (1/3001); "MMCSEngineCreate failed"
I'm running into an undocumented error coming back from CloudKit operations. Specifically, I'm attempting to save new records via CKModifyRecordsOperation. I'm receiving this error for each of the records in the perRecordSaveBlock callback: &lt;CKError 0x3018ac3c0: "Internal Error" (1/3001); "MMCSEngineCreate failed"&gt; Is anyone else facing this error? It has been happening for several days and I'm finally getting around to reproduction with the Console app and logs. I have 16 records on my device locally that each one gets this error back. FB16547732 - CloudKit: CKModifyRecordsOperation saving new records results in Error &lt;CKError 0x3018ac1e0: "Internal Error" (1/3001); "MMCSEngineCreate failed"&gt;
2
0
530
Feb ’25
Timezone for Device Notification statistics?
What timezone is used in the CloudKit Push Notification reporting? Meaning, when I see 1,000 Sent Push Notifications on 2/18, is that 2025-02-18 00:00 through 2025-02-18 23:59 PST? EST? UTC? The metrics shown in [the CloudKit Push Notification reporting] are not lining up with stats from my marketing system, and I'm trying to diagnose. Also, is there a way to see DELIVERIES or just SENT? I'm looking to learn more about why a Notification would be Sent but not received by the user. Thank you!
2
0
393
Feb ’25