Search results for

NSPersistentCloudKitContainer

589 results found

Post

Replies

Boosts

Views

Activity

Reply to CloudKit Notification for Checking if User Upgraded iCloud Storage Space for error handling?
> Then I'd say it's safe to just keep hitting CloudKit with the same request until it succeeds, keeping any additional errors silenced. Here I see that you are able to listen if quota is exceeded or if the sync is successful or not. Is it a manual sync you are doing to the CloudKit or is the container configured as NSPersistentCloudKitContainer? If it is the later, how are you able to listen to these status callbacks? Any leads would be appreciated. TIA
Sep ’20
Reply to Setting up push notifications
Hello Steve, After adding the needed capabilities to your project, NSPersistentCloudKitContainer manages the notification configuration to keep your App (local storage) updated with the CloudKit storage. Here - https://developer.apple.com/documentation/coredata/mirroring_a_core_data_store_with_cloudkit/setting_up_core_data_with_cloudkit you can see the steps to enable the capabilities so your NSPersistentCloudKitContainer can keep your local data updated. Now, keep in mind that the freshness of the data from a Public database is different than from a Private database, NSPersistentCloudKitContainer polls for changes on Application Launch and every 30 minutes, see more detail in this year's WWDC session Sync a Core Data store with the CloudKit public database - min 10:30 - https://developer.apple.com/videos/play/wwdc2020/10650/?t=630. Good luck and feel free to reach out.
Topic: App & System Services SubTopic: General Tags:
Aug ’20
Callback support for NSPersistentCloudKitContainer in iOS14 beta
The callback from syncing of NSPersistentCloudKitContainer is mostly added from iOS14 onwards. I got to know that NSPersistentCloudKitContainer.Event helps to understand sync status of data from CoreData to CloudKit. Use Case: I need to understand the sync status of data from watch to Cloudkit, so that I can choose to send it explicitly to companion phone or not. Has anybody got leads how to use make use of the newly released features forNSPersistentCloudKitContainer in iOS14? For reference : [https://developer.apple.com/documentation/coredata/nspersistentcloudkitcontainer)
2
0
791
Aug ’20
Reply to NSPersistentCloudKitContainer change cloudKitContainerOptions while app is running
I've similar concerns. The contexts from the first container will not be useable (at least in my testing). Short of tearing down the old core data stack, standing up the new one and traversing the view hierarchy to replace all existing managed objects and managed object contexts, there doesn't seem to be a way to toggle sync using NSPersistentCloudKitContainer. Not being able to pause or toggle sync seems to be a real shortcoming with NSPersistentCloudKitContainer. For kicks, I tried just disabling iCloud for the app Settings->AppleID->iCloud->App but that just deleted all the data on the device. I can live with the eventual consistency and not knowing sync progress, but not being able to toggle sync is a show stopper.
Aug ’20
Reply to WidgetKit and CoreData/CloudKit
Hi cristosv, Thanks for posting your solution to this online. I'm having the same problem, but it would be great it for you could help a little more. For example, all your code is working fine, but I can't seem to figure out how to use my core data entity in a Text() view in my widget. Below is my code, and any help with this or more sample code would be great. Thanks 🙏 import WidgetKit import SwiftUI import Intents import CoreData struct Provider: IntentTimelineProvider { func placeholder(in context: Context) -> SimpleEntry { SimpleEntry(date: Date(), configuration: ConfigurationIntent()) } func getSnapshot(for configuration: ConfigurationIntent, in context: Context, completion: @escaping (SimpleEntry) -> ()) { let entry = SimpleEntry(date: Date(), configuration: configuration) completion(entry) } func getTimeline(for configuration: ConfigurationIntent, in context: Context, completion: @escaping (Timeline) -> ()) { var entries: [SimpleEntry] = [] // Generate a timeline consisting of five entries an
Aug ’20
How to import data from iPhone system File to the app other than the app's iCloud at first through Share Extension?
The local data in iPhone system File is inserted to the app core data through Share Extension. The app uses NSPersistentCloudKitContainer to sync core data. But when importing local data from iPhone local File, the data always go to iCloud of the app at first and then syncing data to the app from iCloud. This leads to that the app cannot import data when the iCloud drive is closed or the iCloud is full. Is there any way to import data to the app other than to the app's iCloud at first?
0
0
871
Aug ’20
NSPersistentCloudKitContainer change cloudKitContainerOptions while app is running
I use NSPersistentCloudKitContainer to sync my apps data to iCloud. The app has a settings switch to enable or disable iCloud sync. As described in this thread, - https://developer.apple.com/forums/thread/118924 I set cloudKitContainerOptions to nil depending on the users setting. This is done before the persistent stores are loaded and works fine when the app is launched for the first time. My problem is that I don't know how to apply this settings change while NSPersistentCloudKitContainer is already loaded and active and its ManagedObjectContexts are in use? I could reload the entire container, but will that work while the app is still using contexts from the other container?
3
0
1.4k
Aug ’20
Reply to NSSecureUnarchiveFromData is now necessary for transformable attributes but does not work with Core Data CloudKit?
I was able to remove the warnings by registering a new value transformer. I'm persisting a CLLocation, which conforms to NSSecureCoding. import Foundation import CoreLocation @objc(CLLocationValueTransformer) final class CLLocationValueTransformer: NSSecureUnarchiveFromDataTransformer { static let name = NSValueTransformerName(rawValue: String(describing: CLLocationValueTransformer.self)) override static var allowedTopLevelClasses: [AnyClass] { return [CLLocation.self] } public static func register() { let transformer = CLLocationValueTransformer() ValueTransformer.setValueTransformer(transformer, forName: name) } } Adding CLLocationValueTransformer as the transformer name works without warnings. The value is synced properly via NSPersistentCloudKitContainer, verified on multiple devices.
Aug ’20
[NSPersistentCloudKitContainer][Mac Catalyst specific crash] app is constantly crashing within a minute or two
Core Data, Catalyst, CloudKIt engineers need your assistance. I have an app that uses NSPersistentCloudKitContainer. It works great on iOS, but on the mac (Catalyst), the app is constantly crashing and is unusable. The CloudKit scheduler com.apple.xpc.activity.com.apple.cloudkit.scheduler.com.apple.coredata.cloudkit.activity.export seems to be at fault. It's crashing inside a generic dispatch block, so it's impossible to debug. Found a similar thread: https://developer.apple.com/forums/thread/128131?page=1 This is on Catalina 10.15.5 (19F101). MacBook Pro (Retina, 13-inch, Early 2015) Any ideas on how to debug/solve the root cause of this issue? Here's the image of the crash report (image hosted on imgbb.com): ibb.co nQy6rwm Thread 19 Queue : com.apple.xpc.activity.com.apple.cloudkit.scheduler.com.apple.coredata.cloudkit.activity.export (serial) #0 0x00007fff73de0436 in __xpcactivitydispatchblockinvoke.109.cold.3 () #1 0x00007fff73dde82b in _xpcactivitydispatchblockinvoke.109 () #2 0x000000010040f844
1
0
925
Aug ’20
Why? "CloudKit integration does not support unique constraints"
Hi, On iOS 14 beta 1-3 I was happily using a constraint on several entities in NSPersistentCloudKitContainer. The part of the app using this was essentially an RSS reader - two different devices were independently fetching news and no duplicates due to the constraints. Now on iOS14 beta 4 I'm receiving CloudKit integration does not support unique constraints, which means I've had to remove the constraints.. Now the app is subject to CloudKit sync vs RSS import timing issues.. if CloudKit syncs after the RSS import then there are duplicate items. What's the workaround for this please? It really should just work. Thanks, Andy
6
0
4.6k
Aug ’20