cloudkit

cloudkit error no authToken received for asset

☆樱花仙子☆ 提交于 2019-12-12 08:58:11
问题 Why do I get this error when I run the following code? : "Internal Error" (1/1000); "No authToken received for asset" I think it has something to do with the setObject code in the last line. let documentsDirectoryPath:NSString = NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true)[0] as NSString var imageURL: URL! let imageData = UIImageJPEGRepresentation(self.newImage, 1.0) let path:String = documentsDirectoryPath.appendingPathComponent(self.newImage.description)

CloudKit: Preventing Duplicate Records

你离开我真会死。 提交于 2019-12-12 08:57:50
问题 I am working through an app that pulls data from an external web service into a private CloudKit database. The app is a single user app, however I am running into a race condition that I am not sure how to avoid. Every record in my external data has a unique identifier that I map to my CKRecord instances. The general app startup flow is: Fetch current CKRecords for the relevant record type. Fetch external records. For every external record, if it doesn't exist in CloudKit, create it via batch

CloudKit: CKFetchRecordChangesOperation, CKServerChangeToken and Delta Download

让人想犯罪 __ 提交于 2019-12-12 08:14:28
问题 My question is related to the "Delta Download" thing as it was named in WWDC 2014 Advanced CloudKit. I'm trying to make syncronization for my Core Data app, which is iPhone only for now (think: there is only one device active). So, basically the app will store user records in the cloud from one same device, for the most cases for now. I have trouble with understanding custom zone feature which is based on CKFetchRecordChangesOperation aka Delta Download. As I got it right, we have

Querying private database in swift for user details

て烟熏妆下的殇ゞ 提交于 2019-12-12 03:55:53
问题 I'm trying to save and store the user's data, then retrieve it and check for a value, pushing the corresponding view controller. However, despite only having 4 user records in my cloudkit dashboard, i'm getting 33 results, forcing me to change my code and preventing it from working. This was my original code: let container = CKContainer.defaultContainer() let privateDB = container.privateCloudDatabase let resultPredicate = NSPredicate(format: "TRUEPREDICATE") let query = CKQuery(recordType:

How to identify iCloud logged in user in airplane mode?

若如初见. 提交于 2019-12-12 02:52:26
问题 I try to get userRecordID in airplane mode, but I get an error, any other way? class func asdf() { var defaultContainer = CKContainer.defaultContainer() var publicDatabase = defaultContainer.publicCloudDatabase defaultContainer.fetchUserRecordIDWithCompletionHandler({ userRecordID, error in if error == nil { println("userRecordID.recordName : \(userRecordID.recordName)") } else { println("\(error.localizedDescription)") } }) } Terminal: Couldn't renew our secure session I put an

Select creationDate from CloudKit record

倾然丶 夕夏残阳落幕 提交于 2019-12-11 18:36:14
问题 I'm trying to fill a cell with title and subtitle. Title with the field and detail with the CreationDate from the record. I am trying the following but I am getting a no member 'ObjectForKey' var objects = CKRecord override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell { let reuseIdentifier = "Cell" var cell:UITableViewCell? = tableView.dequeueReusableCellWithIdentifier(reuseIdentifier) as UITableViewCell? if (cell != nil) { cell =

AppDelegate Never Gets Its didReceiveRemoteNotification Called For CKQuerySubscription

人盡茶涼 提交于 2019-12-11 15:18:30
问题 I'm trying to let the iOS app listen to CKQuerySubscription changes. Data is transmitted by a remote iOS app. I already have a macOS application, which does receive data sent by the remote iOS app. The iOS app I have trouble with already has a subscription. Yet, its AppDelegate never receives a call in the didReceiveRemoteNotification method. import UIKit import UserNotifications import CloudKit @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate,

CloudKit: delete CKSubscription is not working

谁说我不能喝 提交于 2019-12-11 12:17:18
问题 Hello i try to cancel a subscription on CloudKit. So far i tried both CKModifySubscriptionsOperation and single removement by publicDB?.deleteSubscriptionWithID. My completionHandler gives me no error and an array of the deleted subscription ID's. So all seems to be ok. But when i change a record i still get a push notification. How to remove the subscriptions? Here is the changed code: func cancelCubscription(subscription:Subscriptions){ self._animationDelegate?.beginAnimation() var subs =

Test NSUserDeletedZone in CloudKit While In Development

半城伤御伤魂 提交于 2019-12-11 11:57:12
问题 Thanks for taking a look. I'm hoping someone can help, I am a bit at my wits end here. I have an application in production that currently does not handle CloudKit's CKErrorUserDeletedZone error. This happens when a user deletes the container data from the Settings->iCloud area on their iPhone/iPad, or System Preferences->iCloud area on their Mac. The problem I am having is I am not able to test this scenario while running from Xcode since it uses the Development not Production servers. Only

In CloudKit, after adding a record, the new record will not appear in a query that is conducted right away. How to solve it?

二次信任 提交于 2019-12-11 11:53:00
问题 I am developing an iOS app using CloudKit. I have a problem: After adding a record using CKModifyRecordsOperation , if I do a query right away using CKQueryOperation to get all the records, then usually the newest record doesn't appear in the query result. It seems that the newest record will appear in queries that are conducted several seconds after the writing operation. So, how to solve it? In my app, when the user add a new record, then the app will refresh the list of all the records.