cloudkit

How to reset the Badge app icon number?

泄露秘密 提交于 2021-02-19 06:57:05
问题 I integrated the Push Notification to the CloudKit so that every change in the iCloud will pop up a notification on my iPhone and the badge app icon number will add one correspondingly. However, when I used the code: application.applicationIconBadgeNumber = 0 to reset that number in the applicationDidBecomeActive(_ application: UIApplication) , I noticed that the badge app icon number truly disappeared but if another new notification came again, the number won't start from one again as

Multiple users editing same CloudKit record

给你一囗甜甜゛ 提交于 2021-02-10 15:43:32
问题 I am building a social media app where multiple users can edit the same CloudKit record at the same time. Should I implement a locking mechanism so that only one user can edit at a time (these edits may conflict with each other), or does CloudKit have a handy built-in way for dealing with this? If I implement a locking mechanism, my plan would be to add a binary attribute to the editable records--this attribute would have a value of 1 if someone else is editing, and 0 if no one is currently

CloudKit CKShare URL Goes Nowhere

你。 提交于 2021-02-08 10:36:23
问题 I have successfully saved a CKShare URL to CloudKit, and I can see that the user is INVITED in the CloudKit Dashboard. My Mac app emailed the URL to that person, but when they click it, all they see it this screen on icloud.com: Clicking OK makes everything disappear so all you see is the background on the web page. My understanding is that the URL is supposed to open my Mac app where it will fire userDidAcceptCloudKitShareWith in my app delegate. But it does nothing. Could this be because my

Unable to fetch records in a sharedCloudDatabase custom Zone using CloudKit

℡╲_俬逩灬. 提交于 2021-02-08 10:35:53
问题 I am trying to fetch CloudKit records from a custom Zone in a sharedDatabase. The zone has been created correctly during the share process. So I assume that the zone is correctly a shared custom zone (it is indeed in my CloudKit user dashboard, appearing under the sharedDatabase of the default container). Even with this simple piece of code to retrieve records: func loadRecords() { let database = CKContainer.default().sharedCloudDatabase let query = CKQuery(recordType: "Items", predicate:

CloudKit CKShare URL Goes Nowhere

时光总嘲笑我的痴心妄想 提交于 2021-02-08 10:34:22
问题 I have successfully saved a CKShare URL to CloudKit, and I can see that the user is INVITED in the CloudKit Dashboard. My Mac app emailed the URL to that person, but when they click it, all they see it this screen on icloud.com: Clicking OK makes everything disappear so all you see is the background on the web page. My understanding is that the URL is supposed to open my Mac app where it will fire userDidAcceptCloudKitShareWith in my app delegate. But it does nothing. Could this be because my

Unable to fetch records in a sharedCloudDatabase custom Zone using CloudKit

为君一笑 提交于 2021-02-08 10:31:27
问题 I am trying to fetch CloudKit records from a custom Zone in a sharedDatabase. The zone has been created correctly during the share process. So I assume that the zone is correctly a shared custom zone (it is indeed in my CloudKit user dashboard, appearing under the sharedDatabase of the default container). Even with this simple piece of code to retrieve records: func loadRecords() { let database = CKContainer.default().sharedCloudDatabase let query = CKQuery(recordType: "Items", predicate:

How to model my CloudKit data

可紊 提交于 2021-02-07 10:12:54
问题 In my app I decided to use CloudKit as my sync-backend. My app is not about projects, but for simplicity let's say so... So... In my app users will have multiple projects. Each of those contains multiple entities associated with that project. For example tasks, but also reminders and so on. All this data will be stored in the users private database. Nothing will be in the public database. Now a user can have multiple projects. My first question: Should each project be in it's own CKRecordZone

How to model my CloudKit data

╄→гoц情女王★ 提交于 2021-02-07 10:09:34
问题 In my app I decided to use CloudKit as my sync-backend. My app is not about projects, but for simplicity let's say so... So... In my app users will have multiple projects. Each of those contains multiple entities associated with that project. For example tasks, but also reminders and so on. All this data will be stored in the users private database. Nothing will be in the public database. Now a user can have multiple projects. My first question: Should each project be in it's own CKRecordZone

How to model my CloudKit data

眉间皱痕 提交于 2021-02-07 10:07:36
问题 In my app I decided to use CloudKit as my sync-backend. My app is not about projects, but for simplicity let's say so... So... In my app users will have multiple projects. Each of those contains multiple entities associated with that project. For example tasks, but also reminders and so on. All this data will be stored in the users private database. Nothing will be in the public database. Now a user can have multiple projects. My first question: Should each project be in it's own CKRecordZone

Core Data + CloudKit not refreshing on other device automatically?

陌路散爱 提交于 2021-01-29 13:38:56
问题 I have my SwiftUI app working with Core Data + CloudKit. I am able to save new entries to the database from my Mac or iPhone. The app uses the exact same project/codebase for all devices. The only problem is that I need to close out of the app and re-open it to see any new entries made from the other device. I can immediately see the new entries made from the same device, but they do not appear on the other devices until I close and re-open the app on it. Am I missing something here? Do I