CloudKit Dashboard

RSS for tag

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

Posts under CloudKit Dashboard tag

88 Posts

Post

Replies

Boosts

Views

Activity

Cloudkit Coredata reset upon user logout iCloud
Hi all, We have an iOS app which has Cloudkit Coredata as storage mechanism. Whenever user logout of iCloud in settings app, then the Coredata is wiped out and no row exists in the tables. Can we prevent this. We want to retain the coredata values until there is another iCloud user logs into settings app. Thanks Vinoth
4
1
2k
Aug ’24
Core Data Records Not Syncing with CloudKit Dashboard
Hello everyone, I'm currently working on an iOS app using SwiftUI and Core Data, integrating CloudKit for data synchronization. I've set up my Core Data stack with NSPersistentCloudKitContainer, and everything appears to be working correctly locally. However, I'm not seeing any records appearing in the CloudKit Dashboard. This issue started occurring after transferring the Apple Developer account ownership and changing the CloudKit container. Here's a summary of my setup and what I've tried so far: Setup PersistenceController.swift import SwiftUI import Foundation import CoreData import CloudKit class PersistenceController { static let shared = PersistenceController() let container: NSPersistentCloudKitContainer init() { container = NSPersistentCloudKitContainer(name: "Model") guard let description = container.persistentStoreDescriptions.first else { fatalError("No Descriptions found") } description.cloudKitContainerOptions = NSPersistentCloudKitContainerOptions(containerIdentifier: "iCloud.com.company.Project") container.loadPersistentStores { (storeDescription, error) in if let error = error as NSError? { fatalError("Unresolved error \(error), \(error.userInfo)") } } container.viewContext.automaticallyMergesChangesFromParent = true } func saveContext() { let context = container.viewContext if context.hasChanges { do { try context.save() } catch { let nserror = error as NSError fatalError("Unresolved error \(nserror), \(nserror.userInfo)") } } } static let preview: PersistenceController = { let controller = PersistenceController() // Remove existing preview data let fetchRequest: NSFetchRequest<NSFetchRequestResult> = Letter.fetchRequest() let batchDeleteRequest = NSBatchDeleteRequest(fetchRequest: fetchRequest) let userFetchRequest: NSFetchRequest<NSFetchRequestResult> = User.fetchRequest() let userBatchDeleteRequest = NSBatchDeleteRequest(fetchRequest: userFetchRequest) let senderFetchRequest: NSFetchRequest<NSFetchRequestResult> = Sender.fetchRequest() let senderBatchDeleteRequest = NSBatchDeleteRequest(fetchRequest: senderFetchRequest) do { try controller.container.viewContext.execute(batchDeleteRequest) try controller.container.viewContext.execute(userBatchDeleteRequest) try controller.container.viewContext.execute(senderBatchDeleteRequest) try controller.container.viewContext.save() } catch { fatalError("Failed to delete preview data: \(error)") } } Entitlements.plist <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>aps-environment</key> <string>development</string> <key>com.apple.developer.applesignin</key> <array> <string>Default</string> </array> <key>com.apple.developer.icloud-container-identifiers</key> <array> <string>iCloud.com.company.Project</string> </array> <key>com.apple.developer.icloud-services</key> <array> <string>CloudKit</string> </array> </dict> </plist> What I've Tried Verified that the iCloud capability is enabled in the Xcode project settings. Checked the containerIdentifier in the NSPersistentCloudKitContainer setup. Ensured the app is signed in with the correct iCloud account. Observed that local Core Data operations work correctly and save without errors. Waited to ensure any potential synchronization delays are accounted for. Observations I see debug messages in the Xcode console indicating that records are being serialized and saved to CloudKit, but they do not appear in the CloudKit Dashboard. I have verified that I'm looking at the correct Private Database and _defaultZone. When I delete the app and reinstall it, I can see that the data remains, indicating that the data is being stored somewhere in iCloud but not visible in the CloudKit Dashboard. After resetting the schema in the CloudKit Console and running the app, the schema (including record types) syncs immediately, but the records are still not visible. Console Output CoreData: debug: CoreData+CloudKit: -[PFCloudKitSerializer newCKRecordsFromObject:fullyMaterializeRecords:includeRelationships:error:](576): Serializer has finished creating record: <CKRecord: 0x15b13e600; recordType=CD_Letter, recordID=F879D7B8-0338-418D-A330-6B9DF7947C6A:(com.apple.coredata.cloudkit.zone:__defaultOwner__), values={ "CD_content" = "Dear User. Happy Valentine's Day! Today. l want to remind you of how much you mean to me. Your presence in my life fills my heart with joy and love. Thank you for being my confidant, my friend, and my love. Every moment with you is precious, and I look forward to creating many more beautiful memories together. With all my love, Thomas"; "CD_createdAt" = "2024-07-30 03:17:13 +0000"; "CD_date" = "2024-07-30 03:15:58 +0000"; "CD_emotion" = Lovely; "CD_entityName" = Letter; "CD_icon" = "❤️‍🔥"; "CD_id" = "81569A99-E74C-43AF-B346-220A75EA336E"; "CD_imageData" = "{ length=282816, sha256=a76343766534e061472e243deec7f0b428c85e8a6b94e6cd761443c45f5be41c }"; "CD_primaryAlpha" = "0.4313725490196079"; "CD_primaryBlue" = 0; "CD_primaryGreen" = "0.09014883061658401"; "CD_primaryRed" = "0.4156862745098039"; "CD_secondaryAlpha" = 1; "CD_secondaryBlue" = "0.8823529411764706"; "CD_secondaryGreen" = "0.8784313725490196"; "CD_secondaryRed" = "0.9490196078431372"; "CD_sender" = "EF893D7E-E9E9-453B-B76E-6A5D77E14AA3"; "CD_tertiaryAlpha" = 1; "CD_tertiaryBlue" = "0.8823529411764706"; "CD_tertiaryGreen" = "0.8784313725490196"; "CD_tertiaryRed" = "0.9490196078431372"; "CD_title" = "I love you"; }> Despite this, no records are found in the CloudKit Dashboard. Request for Assistance Are there any additional steps I might have missed to ensure that records sync correctly with CloudKit? Could there be any known issues or additional configurations required for syncing Core Data with CloudKit? Any advice on further troubleshooting steps or areas to investigate would be greatly appreciated. Thank you for your time and assistance!
1
0
1.2k
Jul ’24
Questions About CloudKit Security Roles and Permissions
Hi, I'm using CloudKit to create an app that backs up and records your data to iCloud. Here's what I'm unsure about: I understand that the 'CloudKit Dashboard' has 'Security Roles'. I thought these were meant to set permissions for accessing and modifying users' data, but I found there was no change even when I removed all 'Permissions' from 'Default Roles'. Can you clarify? I'd like to know what _world, _icloud, and _creator in Default Roles mean respectively. I would like to know what changes the creation, read, and write permissions make. Is it better to just use the default settings? Here's what I understand so far: Default Roles: _world: I don't know _icloud: An account that is not my device but is linked to my iCloud _creator: My Device Permissions: create: Create data read: Read data write: Update and delete data. I'm not sure if I understand this correctly. Please explain.
1
0
1.4k
Jul ’24
Adding indexes more difficult with updated cloudkit console
Can the cloudkit console team please look into managing indexes with their updated cloudkit console tool? Working with Record indexes used to be straightforward but it has now become cumbersome and unintuitive. For example, why does the tool force you to fill in some name field if adding a queryable index for recordName? Why can't you create several index types at once for a given field? It is possible to manage schemas in some other ways but for small changes the console used to be handy. It's now become a pain. Thanks!
0
3
685
Jul ’24
How can a user change some data in the public data base?
I am using the public cloud database to store my application data, this data is accessed by all users of the application, but at some point it is necessary for a user who did not create a respective data in the database to delete it, but from what I read in the documentation this is not possible, only with a permission. How do I allow a user to change or delete any data created by another user in the public cloud database?
1
0
772
Jun ’24
Deleting CloudKit data
I have been testing an app which uses cloudKit with SWIFTDATA and after testing for several months my 200GB iCloud store is showing 168GB for iCloud Drive. Now my iCloud drive is only 22.6GB so the rest of the 168GB must be data from my app. Also, I have function in my app to delete all iCloud Data which I thought that should clean up iCloud storage but it does not. I tried resetting the Develop Environment but no change to iCloud data. Also I have several other containers in iCloud created while getting iCloud working which I would like to delete but I understand you can’t. https://forums.developer.apple.com/forums/thread/45251?answerId=788694022#788694022 Bottom line cloudkit console has been pretty much useless for me and I need a way to manage (delete containers and data). Am I missing something?
1
0
1.2k
Jun ’24
What Apple user account do you use when testing CloudKit in Xcode
I currently have a production app that uses CloudKit I always struggle with testing the data within the development container and I was wondering if someone could share their current workflow. What is your current workflow when testing apps that use CloudKit, do you use your regular Apple User account for testing, or you use separate account? My concern is because I use my production app on a daily basis using my regular Apple user account, so I would like to keep the production iCloud data intact. In other words, I have my app on my phone with real data and now I need to test the app because there are some CloudKit syncing issues so I have the following questions. Can I connect my phone with production data to Xcode and use my regular Apple account for testing purposes? Will I be able to see the testing data in the CloudKit console? Will the production data merge with the testing data? I actually created a second Apple account thinking that I could use it for testing but logging off and logging back on to iCloud in your iPhone it's a pain, is this really what needs to be done? Any ideas would be greatly appreciated. Thanks
0
0
882
Apr ’24
How can I see the public data from the Cloudkit public database on the dashboard?
In WWDC2020, the video "Synchronizing a local store to the cloud" shows some data fields in the left column of the dashboard, such as CD_post, CD_Tag, where did these come from? need to create it manually on dababoard, or it synchronize from the demo app ? why do I run this corresponding demo, but there are no data fields in the dashboard of my account and my dashboard of my account is almost empty?
0
0
688
Mar ’24
Unable to access CloudKit Database containers
Hello, We have a problem and we don't know how to solve it. Our application uses CloudKit databases. We can no longer access the CloudKit databases. When we connect to the CloudKit console and select CloudKit Database, we get the message "No Containers". However, the application continues to work by downloading files located on CloudKit Database. How can I modify CloudKit Database data?
0
0
706
Feb ’24
Using CloudKit JS for a React web app
Hello, everyone! I'm currently working in creating a new web app that will replicate the functionalities of an existing iOS and Mac app. However, since those apps rely on CloudKit to manage all user information, we decided on using CloudKit JS as our backend for our web app. The framework we chose for developing our frontend is React. The question is, since this documentation only mentions the CloudKit JS usage through a CDN (embedded directly in the HTML file) I wanted to ask: is there a "suggested" method for using CloudKit JS in a React project other than importing the CDN in the main html file? in case not, should we use a "traditional" server to access data like they suggest in this thread? All your help will be very much appreciated. Best regards, Eduardo
1
2
1.5k
Jan ’24
Can CloudKit security rules be scoped to an application?
I'm building two apps. They both share a CloudKit container. One application is designed to edit the contents of the public database regardless of who a record's creator is. The other should only be allowed to read from the public database. Since CloudKit is largely a client-side framework it's easy enough to enforce this client side. Are there any additional guarantees that iCloud provides to enforce what the clients are signed to do? Or is there a risk of having some actor tamper with the public database that isn't using the editing application?
0
0
690
Jan ’24
CloudKit Data Startup Issue
Afternoon all, I am starting out and want to store data in the App, some will be user specific and some general. So I have a new developer account which should have CloudKit permissions. I am just trying to make any of the most basic example applications work, but keep hitting issues. I create an App, select CloudKit and SwiftData. When I go into the signing and capabilities I select the Team which has the developer account. Then the CloudKit is selected as I clicked it when creating the project, but no Container is selected. I create a Container using the +, it names it iCloud.com.mydomain.AppName. However it is coloured in Red text. I press the refresh and then it turns into black text, the Push Notifications appear all populated for 1 second then all disappear. I have nothing under Push now, only a Trashcan button. The Container is now selected however. Is this an issue that the Push notifications items appeared then vanished? When I then try to run the app, using any of the many attempts I have had with simple code samples, it always fails to create the Container, usually with an error like this: error: Store failed to load. <NSPersistentStoreDescription: 0x600000c79ce0> (type: SQLite, url: file:///Users/cal/Library/Developer/CoreSimulator/Devices/6D2BA1B3-C7CA-499D-A280-AFF4C5E98180/data/Containers/Data/Application/B9CD5E35-08BD-44CC-A72D-EB170E3691C6/Library/Application%20Support/default.store) with error = Error Domain=NSCocoaErrorDomain Code=134060 "A Core Data error occurred." UserInfo={NSLocalizedFailureReason=CloudKit integration requires that all attributes be optional, or have a default value set. The following attributes are marked non-optional but do not have a default value: Item: name} with userInfo { NSLocalizedFailureReason = "CloudKit integration requires that all attributes be optional, or have a default value set. The following attributes are marked non-optional but do not have a default value:\nItem: name"; If I go into the CloudKit database view on Apple, I see the Container listed, albeit it is marked as not deployed to production. To try to remove my newbie issues I have used many web examples, the most recent of which was the "A Beginner’s Guide to SwiftData with a to-do app" from medium.com, which should just work really, snipped from Item.swift below but I have tried several other simple examples which all give the same issue: import Foundation import SwiftData @Model class Item: Identifiable { var name: String init(name: String){ self.name = name } } Any ideas really appreciated. Thank you
2
0
1.2k
Jan ’24
CloudKit Public Database and User Access
Hello, I have a couple of questions about the CloudKit public database: Is it possible to control what authenticated users can write to the database on the server side? I know I could write logic in my iOS app to prevent to prevent certain actions, like uploading more data than I want to allow, but traditionally one would write server-side checks too. Even if I don't use CloudKit JS, it still seems like a malicious user could intercept network traffic and interact directly with iCloud to bypass any validations I've included in my app. Is it possible to block a user from using my app and interacting with CloudKit entirely? Along the same lines as question 1, I may want to block a malicious user from interacting with my public database, particularly writing to it. Is it common practice to write configuration settings to the public database as an administrative user and to have the app look for these known records? For example, I could add records to a configuration zone via the iCloud dashboard and have my app read them at startup to do things like enable/disable signups. Thanks for any help and guidance on these issues!
0
0
787
Nov ’23
CloudKit subscription only works when operation is performed in CloudKit Dashboard and not when done programmatically
I have set up a CKQuerySubscription in the default zone that sends a Push notification every time a record meeting the given criteria is deleted in a public CloudKit database. However, the notification is only sent when I delete the record via the CloudKit Dashboard and not when I delete a record programmatically. I have tried creating a record with User A on a device and then having that record deleted by User B on a different device but it doesn't result in User A getting notified. Additionally, the only case where the notification gets sent is on a device that is signed in with the iCloud account that I use for CloudKit Console. In other words, when I delete a record that was created by a user with a different iCloud account than the one I use for the CloudKit Console the notification does not get sent to that device - it's only successful on the device with the CloudKit Console iCloud account. What I expect to happen is the subscription to fire when the record in question is deleted regardless of how and by whom it is deleted. Is this possible? Any help would be appreciated.
1
1
817
Oct ’23
Cloudkit Coredata reset upon user logout iCloud
Hi all, We have an iOS app which has Cloudkit Coredata as storage mechanism. Whenever user logout of iCloud in settings app, then the Coredata is wiped out and no row exists in the tables. Can we prevent this. We want to retain the coredata values until there is another iCloud user logs into settings app. Thanks Vinoth
Replies
4
Boosts
1
Views
2k
Activity
Aug ’24
Core Data Records Not Syncing with CloudKit Dashboard
Hello everyone, I'm currently working on an iOS app using SwiftUI and Core Data, integrating CloudKit for data synchronization. I've set up my Core Data stack with NSPersistentCloudKitContainer, and everything appears to be working correctly locally. However, I'm not seeing any records appearing in the CloudKit Dashboard. This issue started occurring after transferring the Apple Developer account ownership and changing the CloudKit container. Here's a summary of my setup and what I've tried so far: Setup PersistenceController.swift import SwiftUI import Foundation import CoreData import CloudKit class PersistenceController { static let shared = PersistenceController() let container: NSPersistentCloudKitContainer init() { container = NSPersistentCloudKitContainer(name: "Model") guard let description = container.persistentStoreDescriptions.first else { fatalError("No Descriptions found") } description.cloudKitContainerOptions = NSPersistentCloudKitContainerOptions(containerIdentifier: "iCloud.com.company.Project") container.loadPersistentStores { (storeDescription, error) in if let error = error as NSError? { fatalError("Unresolved error \(error), \(error.userInfo)") } } container.viewContext.automaticallyMergesChangesFromParent = true } func saveContext() { let context = container.viewContext if context.hasChanges { do { try context.save() } catch { let nserror = error as NSError fatalError("Unresolved error \(nserror), \(nserror.userInfo)") } } } static let preview: PersistenceController = { let controller = PersistenceController() // Remove existing preview data let fetchRequest: NSFetchRequest<NSFetchRequestResult> = Letter.fetchRequest() let batchDeleteRequest = NSBatchDeleteRequest(fetchRequest: fetchRequest) let userFetchRequest: NSFetchRequest<NSFetchRequestResult> = User.fetchRequest() let userBatchDeleteRequest = NSBatchDeleteRequest(fetchRequest: userFetchRequest) let senderFetchRequest: NSFetchRequest<NSFetchRequestResult> = Sender.fetchRequest() let senderBatchDeleteRequest = NSBatchDeleteRequest(fetchRequest: senderFetchRequest) do { try controller.container.viewContext.execute(batchDeleteRequest) try controller.container.viewContext.execute(userBatchDeleteRequest) try controller.container.viewContext.execute(senderBatchDeleteRequest) try controller.container.viewContext.save() } catch { fatalError("Failed to delete preview data: \(error)") } } Entitlements.plist <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>aps-environment</key> <string>development</string> <key>com.apple.developer.applesignin</key> <array> <string>Default</string> </array> <key>com.apple.developer.icloud-container-identifiers</key> <array> <string>iCloud.com.company.Project</string> </array> <key>com.apple.developer.icloud-services</key> <array> <string>CloudKit</string> </array> </dict> </plist> What I've Tried Verified that the iCloud capability is enabled in the Xcode project settings. Checked the containerIdentifier in the NSPersistentCloudKitContainer setup. Ensured the app is signed in with the correct iCloud account. Observed that local Core Data operations work correctly and save without errors. Waited to ensure any potential synchronization delays are accounted for. Observations I see debug messages in the Xcode console indicating that records are being serialized and saved to CloudKit, but they do not appear in the CloudKit Dashboard. I have verified that I'm looking at the correct Private Database and _defaultZone. When I delete the app and reinstall it, I can see that the data remains, indicating that the data is being stored somewhere in iCloud but not visible in the CloudKit Dashboard. After resetting the schema in the CloudKit Console and running the app, the schema (including record types) syncs immediately, but the records are still not visible. Console Output CoreData: debug: CoreData+CloudKit: -[PFCloudKitSerializer newCKRecordsFromObject:fullyMaterializeRecords:includeRelationships:error:](576): Serializer has finished creating record: <CKRecord: 0x15b13e600; recordType=CD_Letter, recordID=F879D7B8-0338-418D-A330-6B9DF7947C6A:(com.apple.coredata.cloudkit.zone:__defaultOwner__), values={ "CD_content" = "Dear User. Happy Valentine's Day! Today. l want to remind you of how much you mean to me. Your presence in my life fills my heart with joy and love. Thank you for being my confidant, my friend, and my love. Every moment with you is precious, and I look forward to creating many more beautiful memories together. With all my love, Thomas"; "CD_createdAt" = "2024-07-30 03:17:13 +0000"; "CD_date" = "2024-07-30 03:15:58 +0000"; "CD_emotion" = Lovely; "CD_entityName" = Letter; "CD_icon" = "❤️‍🔥"; "CD_id" = "81569A99-E74C-43AF-B346-220A75EA336E"; "CD_imageData" = "{ length=282816, sha256=a76343766534e061472e243deec7f0b428c85e8a6b94e6cd761443c45f5be41c }"; "CD_primaryAlpha" = "0.4313725490196079"; "CD_primaryBlue" = 0; "CD_primaryGreen" = "0.09014883061658401"; "CD_primaryRed" = "0.4156862745098039"; "CD_secondaryAlpha" = 1; "CD_secondaryBlue" = "0.8823529411764706"; "CD_secondaryGreen" = "0.8784313725490196"; "CD_secondaryRed" = "0.9490196078431372"; "CD_sender" = "EF893D7E-E9E9-453B-B76E-6A5D77E14AA3"; "CD_tertiaryAlpha" = 1; "CD_tertiaryBlue" = "0.8823529411764706"; "CD_tertiaryGreen" = "0.8784313725490196"; "CD_tertiaryRed" = "0.9490196078431372"; "CD_title" = "I love you"; }> Despite this, no records are found in the CloudKit Dashboard. Request for Assistance Are there any additional steps I might have missed to ensure that records sync correctly with CloudKit? Could there be any known issues or additional configurations required for syncing Core Data with CloudKit? Any advice on further troubleshooting steps or areas to investigate would be greatly appreciated. Thank you for your time and assistance!
Replies
1
Boosts
0
Views
1.2k
Activity
Jul ’24
Questions About CloudKit Security Roles and Permissions
Hi, I'm using CloudKit to create an app that backs up and records your data to iCloud. Here's what I'm unsure about: I understand that the 'CloudKit Dashboard' has 'Security Roles'. I thought these were meant to set permissions for accessing and modifying users' data, but I found there was no change even when I removed all 'Permissions' from 'Default Roles'. Can you clarify? I'd like to know what _world, _icloud, and _creator in Default Roles mean respectively. I would like to know what changes the creation, read, and write permissions make. Is it better to just use the default settings? Here's what I understand so far: Default Roles: _world: I don't know _icloud: An account that is not my device but is linked to my iCloud _creator: My Device Permissions: create: Create data read: Read data write: Update and delete data. I'm not sure if I understand this correctly. Please explain.
Replies
1
Boosts
0
Views
1.4k
Activity
Jul ’24
Adding indexes more difficult with updated cloudkit console
Can the cloudkit console team please look into managing indexes with their updated cloudkit console tool? Working with Record indexes used to be straightforward but it has now become cumbersome and unintuitive. For example, why does the tool force you to fill in some name field if adding a queryable index for recordName? Why can't you create several index types at once for a given field? It is possible to manage schemas in some other ways but for small changes the console used to be handy. It's now become a pain. Thanks!
Replies
0
Boosts
3
Views
685
Activity
Jul ’24
How can a user change some data in the public data base?
I am using the public cloud database to store my application data, this data is accessed by all users of the application, but at some point it is necessary for a user who did not create a respective data in the database to delete it, but from what I read in the documentation this is not possible, only with a permission. How do I allow a user to change or delete any data created by another user in the public cloud database?
Replies
1
Boosts
0
Views
772
Activity
Jun ’24
Deleting CloudKit data
I have been testing an app which uses cloudKit with SWIFTDATA and after testing for several months my 200GB iCloud store is showing 168GB for iCloud Drive. Now my iCloud drive is only 22.6GB so the rest of the 168GB must be data from my app. Also, I have function in my app to delete all iCloud Data which I thought that should clean up iCloud storage but it does not. I tried resetting the Develop Environment but no change to iCloud data. Also I have several other containers in iCloud created while getting iCloud working which I would like to delete but I understand you can’t. https://forums.developer.apple.com/forums/thread/45251?answerId=788694022#788694022 Bottom line cloudkit console has been pretty much useless for me and I need a way to manage (delete containers and data). Am I missing something?
Replies
1
Boosts
0
Views
1.2k
Activity
Jun ’24
What Apple user account do you use when testing CloudKit in Xcode
I currently have a production app that uses CloudKit I always struggle with testing the data within the development container and I was wondering if someone could share their current workflow. What is your current workflow when testing apps that use CloudKit, do you use your regular Apple User account for testing, or you use separate account? My concern is because I use my production app on a daily basis using my regular Apple user account, so I would like to keep the production iCloud data intact. In other words, I have my app on my phone with real data and now I need to test the app because there are some CloudKit syncing issues so I have the following questions. Can I connect my phone with production data to Xcode and use my regular Apple account for testing purposes? Will I be able to see the testing data in the CloudKit console? Will the production data merge with the testing data? I actually created a second Apple account thinking that I could use it for testing but logging off and logging back on to iCloud in your iPhone it's a pain, is this really what needs to be done? Any ideas would be greatly appreciated. Thanks
Replies
0
Boosts
0
Views
882
Activity
Apr ’24
How can I see the public data from the Cloudkit public database on the dashboard?
In WWDC2020, the video "Synchronizing a local store to the cloud" shows some data fields in the left column of the dashboard, such as CD_post, CD_Tag, where did these come from? need to create it manually on dababoard, or it synchronize from the demo app ? why do I run this corresponding demo, but there are no data fields in the dashboard of my account and my dashboard of my account is almost empty?
Replies
0
Boosts
0
Views
688
Activity
Mar ’24
Unable to access CloudKit Database containers
Hello, We have a problem and we don't know how to solve it. Our application uses CloudKit databases. We can no longer access the CloudKit databases. When we connect to the CloudKit console and select CloudKit Database, we get the message "No Containers". However, the application continues to work by downloading files located on CloudKit Database. How can I modify CloudKit Database data?
Replies
0
Boosts
0
Views
706
Activity
Feb ’24
Using CloudKit JS for a React web app
Hello, everyone! I'm currently working in creating a new web app that will replicate the functionalities of an existing iOS and Mac app. However, since those apps rely on CloudKit to manage all user information, we decided on using CloudKit JS as our backend for our web app. The framework we chose for developing our frontend is React. The question is, since this documentation only mentions the CloudKit JS usage through a CDN (embedded directly in the HTML file) I wanted to ask: is there a "suggested" method for using CloudKit JS in a React project other than importing the CDN in the main html file? in case not, should we use a "traditional" server to access data like they suggest in this thread? All your help will be very much appreciated. Best regards, Eduardo
Replies
1
Boosts
2
Views
1.5k
Activity
Jan ’24
Can CloudKit security rules be scoped to an application?
I'm building two apps. They both share a CloudKit container. One application is designed to edit the contents of the public database regardless of who a record's creator is. The other should only be allowed to read from the public database. Since CloudKit is largely a client-side framework it's easy enough to enforce this client side. Are there any additional guarantees that iCloud provides to enforce what the clients are signed to do? Or is there a risk of having some actor tamper with the public database that isn't using the editing application?
Replies
0
Boosts
0
Views
690
Activity
Jan ’24
CloudKit Data Startup Issue
Afternoon all, I am starting out and want to store data in the App, some will be user specific and some general. So I have a new developer account which should have CloudKit permissions. I am just trying to make any of the most basic example applications work, but keep hitting issues. I create an App, select CloudKit and SwiftData. When I go into the signing and capabilities I select the Team which has the developer account. Then the CloudKit is selected as I clicked it when creating the project, but no Container is selected. I create a Container using the +, it names it iCloud.com.mydomain.AppName. However it is coloured in Red text. I press the refresh and then it turns into black text, the Push Notifications appear all populated for 1 second then all disappear. I have nothing under Push now, only a Trashcan button. The Container is now selected however. Is this an issue that the Push notifications items appeared then vanished? When I then try to run the app, using any of the many attempts I have had with simple code samples, it always fails to create the Container, usually with an error like this: error: Store failed to load. <NSPersistentStoreDescription: 0x600000c79ce0> (type: SQLite, url: file:///Users/cal/Library/Developer/CoreSimulator/Devices/6D2BA1B3-C7CA-499D-A280-AFF4C5E98180/data/Containers/Data/Application/B9CD5E35-08BD-44CC-A72D-EB170E3691C6/Library/Application%20Support/default.store) with error = Error Domain=NSCocoaErrorDomain Code=134060 "A Core Data error occurred." UserInfo={NSLocalizedFailureReason=CloudKit integration requires that all attributes be optional, or have a default value set. The following attributes are marked non-optional but do not have a default value: Item: name} with userInfo { NSLocalizedFailureReason = "CloudKit integration requires that all attributes be optional, or have a default value set. The following attributes are marked non-optional but do not have a default value:\nItem: name"; If I go into the CloudKit database view on Apple, I see the Container listed, albeit it is marked as not deployed to production. To try to remove my newbie issues I have used many web examples, the most recent of which was the "A Beginner’s Guide to SwiftData with a to-do app" from medium.com, which should just work really, snipped from Item.swift below but I have tried several other simple examples which all give the same issue: import Foundation import SwiftData @Model class Item: Identifiable { var name: String init(name: String){ self.name = name } } Any ideas really appreciated. Thank you
Replies
2
Boosts
0
Views
1.2k
Activity
Jan ’24
CloudKit Public Database and User Access
Hello, I have a couple of questions about the CloudKit public database: Is it possible to control what authenticated users can write to the database on the server side? I know I could write logic in my iOS app to prevent to prevent certain actions, like uploading more data than I want to allow, but traditionally one would write server-side checks too. Even if I don't use CloudKit JS, it still seems like a malicious user could intercept network traffic and interact directly with iCloud to bypass any validations I've included in my app. Is it possible to block a user from using my app and interacting with CloudKit entirely? Along the same lines as question 1, I may want to block a malicious user from interacting with my public database, particularly writing to it. Is it common practice to write configuration settings to the public database as an administrative user and to have the app look for these known records? For example, I could add records to a configuration zone via the iCloud dashboard and have my app read them at startup to do things like enable/disable signups. Thanks for any help and guidance on these issues!
Replies
0
Boosts
0
Views
787
Activity
Nov ’23
CloudKit subscription only works when operation is performed in CloudKit Dashboard and not when done programmatically
I have set up a CKQuerySubscription in the default zone that sends a Push notification every time a record meeting the given criteria is deleted in a public CloudKit database. However, the notification is only sent when I delete the record via the CloudKit Dashboard and not when I delete a record programmatically. I have tried creating a record with User A on a device and then having that record deleted by User B on a different device but it doesn't result in User A getting notified. Additionally, the only case where the notification gets sent is on a device that is signed in with the iCloud account that I use for CloudKit Console. In other words, when I delete a record that was created by a user with a different iCloud account than the one I use for the CloudKit Console the notification does not get sent to that device - it's only successful on the device with the CloudKit Console iCloud account. What I expect to happen is the subscription to fire when the record in question is deleted regardless of how and by whom it is deleted. Is this possible? Any help would be appreciated.
Replies
1
Boosts
1
Views
817
Activity
Oct ’23