cloudkit

Cloudkit: CKDatabaseOperation not working on cellular

Deadly 提交于 2019-12-07 22:23:59
问题 Hi to all the CloudKit users: I had a horrible time trying to find out why CKDatabaseOperation wouldn't give any feedback. No errors, no callbacks when saving CKRecords on cellular. Could you please let me know what is your opinion regarding this? 回答1: Someone in the Developer Forums of Apple found a solution: https://forums.developer.apple.com/thread/20047 the magic happens when setting qualityOfService = .UserInitiated Example: let publicDB = CKContainer.defaultContainer()

SWIFT: I don't get notifications from my CloudKit app?

强颜欢笑 提交于 2019-12-07 15:57:30
Here is my code: @IBAction func sendSweet(sender: AnyObject) { //delegate method let newSweet = CKRecord(recordType: "Extra1") newSweet["content"] = textField.text let publicData = CKContainer.defaultContainer().publicCloudDatabase publicData.saveRecord(newSweet, completionHandler: { (record:CKRecord?, error:NSError?) -> Void in if error == nil { dispatch_async(dispatch_get_main_queue(), { () -> Void in self.tableView.beginUpdates() self.sweets.insert(newSweet, atIndex: 0) let indexPath = NSIndexPath(forRow: 0, inSection: 0) self.tableView.insertRowsAtIndexPaths([indexPath], withRowAnimation:

CloudKit Push Notification, App running on background

我的未来我决定 提交于 2019-12-07 09:48:27
问题 When iOS8.2-app is running in the background, it does not receive any push notification, while if it is running on the foreground, it receives the push notifications fine. Any idea what is going on ? Running on CloudKit Development mode, the subscription is for add,edit,and remove, and using the following didReceiveRemoteNotification : -(void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult)

Which restriction an app with CloudKit has if user does not turn on iCloud Drive

元气小坏坏 提交于 2019-12-07 05:40:58
问题 Which CloudKit services are not available if user not turns on iCloud Drive? Is it any way to turn on iCloud Drive from app? I guess downloading records from public container should work regardless iCloud Drive, writing container only if it is enabled?! 回答1: CloudKit is linked to the iCloud account. If the user is login in into iCloud, but does not have iCloudDrive enabled, then there are no limitations to CloudKit. If the user is not logged in into iCloud, then he can only access public data

creatorUserRecordID.recordName contains “__defaultOwner__” instead of UUID shown in Dashboard

馋奶兔 提交于 2019-12-07 05:09:46
问题 Downloading a CKRecord from CloudKit and when plotting creator recordName , I can see this: (lldb) po record.creatorUserRecordID.recordName __defaultOwner__ but, Dashboard show a real value. Why the difference?! I hope I do not have to download only because of this the logged in user first?! 回答1: "__defaultOwner__" mean's its owned by the currently logged in iCloud account. So you could replace that with "Me" or the person's name if you have it. If you want to find out the logged in user's

cloudkit: how to access main user's attributes?

流过昼夜 提交于 2019-12-07 03:49:27
I am trying to make an app in which every user would have a personal avatar, a nickname and so on. I don't know how to access the user's account on cloudkit. My solution would be to retrieve user's AppleID, query Cloudkit and modify the user's attribute... But I guess there should be a better way to do it. Isn't their something like NSUserDefault but for cloudkit? You first have to find out what the current loged in userId is. You can do that by executing the fetchUserRecordIDWithCompletionHandler method on the container. Then you can get more (currently only first and last name) information

(iOS 10, Swift 3) Reading `userInfo` dictionary from a CloudKit notification: How do I cast `[AnyHashable : Any]` to `[String : NSObject]`?

痞子三分冷 提交于 2019-12-07 02:56:55
问题 Background I'm trying to load the userInfo dictionary from application:didReceiveRemoteNotification:userInfo:fetchCompletionHandler in my app delegate. I then need to cast userInfo from [AnyHashable:Any] to [String:NSObject] so I can use it in CloudKit's CKNotification:fromRemoteNotificationDictionary . Question When I do: let ui = userInfo as! [String : NSObject] I get the error: '[AnyHashable:Any]' is not convertible to '[String:NSObject]' Is there a better way to convert userInfo to the

CKReference .DeleteSelf attribute has no effect

不打扰是莪最后的温柔 提交于 2019-12-07 02:22:55
问题 How does .DeleteSelf really work? Docs says: When the reference object’s action is set to CKReferenceActionDeleteSelf, the target of the reference—that is, the record stored in the reference’s recordID property—becomes the owner of the source record. Deleting the target (owner) record deletes all its source records. but my impression is that deleting a target will not always delete source. And it is quite annoying when it remains in the container, client downloads it, and expect that the

Full CoreData uploading (backup) to iCloud Drive and restore if need

。_饼干妹妹 提交于 2019-12-06 16:30:29
My project is CoreData-based application. Is it enough to upload sqlite-file to CloudDrive for restoring data when need? Is there any tutorials how to implement it? Nothing for you to do. Just enable iCloud and it will always be backed up and restorable automatically. See Enable iCloud with Core Data . It's really simple. 来源: https://stackoverflow.com/questions/30886331/full-coredata-uploading-backup-to-icloud-drive-and-restore-if-need

How can I get missed CloudKit notification while app is in the background mode?

梦想的初衷 提交于 2019-12-06 16:23:39
问题 CloudKit manages my notifications ( not my dedicated server ) My first device changes sth in CloudKit Container and pushes notification. ... but on my second device my app is currently running in background mode. So... the notification arrives to device with Alert , but the app itself doesn't know about it. What is the elegant and effective way to catch this one missed notification (or even more) when the app goes back to the foreground mode? Suppose the change is related to my top visible