cloudkit

Seed and maintain CloudKit public database without requiring iCloud login?

天大地大妈咪最大 提交于 2019-12-28 07:09:08
问题 The Apple docs say reads from an app's CloudKit public database can occur without an iCloud login, but writes cannot. Saving or updating records to the public database require an iCloud login. What if you want to seed and maintain the public database as an administrator? For instance, for a map app, if you as an administrator want to populate and maintain the public database with demographic data for each country, does your flow still require an iCloud login? If posting code snippets, Swift

CloudKit won't reset my badge count to 0

荒凉一梦 提交于 2019-12-28 06:46:06
问题 I've tried a number of things and can't seem to reset the badge count from notifications comings from cloudKit. Has anyone else ran into this problem. Here is what I've tried: 1) Set the badge count locally to 0 application.applicationIconBadgeNumber = 0; (temporarily removes the badge count). No luck... 2) Call the server to clear the badge count CKModifyBadgeOperation *oper = [[CKModifyBadgeOperation alloc] initWithBadgeValue:0]; [oper start]; No luck... 3) Pull in all notification changes

Fetching Public Record From iCloud Using CloudKit

自作多情 提交于 2019-12-25 07:47:13
问题 I have the following code for uploading my assets to iCloud func uploadAsset(recordType: String, fileURL: URL) { let record = CKRecord(recordType: recordType) record["file"] = CKAsset(fileURL: fileURL) CKContainer.default().publicCloudDatabase.save(record) { savedRecord, error in if let saveError = error { print("An error occurred in \(saveError)") } else { print(savedRecord) } } } It definitely works because I am able to go onto the CloudKit dashboard, and physically see the records as well

Cloudkit suddenly unable to upload because “Couldn't get a signing certificate”

本秂侑毒 提交于 2019-12-25 07:23:39
问题 Just today as I try to upload a CKAsset to cloudkit, I am returned the error <CKError 0x155128f0: "Internal Error" (1/4000); "Couldn't get a signing certificate"> This was working perfectly before and was not throwing this error. Does anyone know why this is happening or if it is a problem on Apple's side? 来源: https://stackoverflow.com/questions/39419929/cloudkit-suddenly-unable-to-upload-because-couldnt-get-a-signing-certificate

Is it possible to create a class that will imitate a CKRecord?

懵懂的女人 提交于 2019-12-25 04:12:34
问题 So I'm creating an app that will be reusing some records a lot, so I came up with an idea to do that: import CloudKit class Class: CKRecord { override init(recordType: String = "Class") { super.init(recordType: recordType) } required init?(coder aDecoder: NSCoder) { fatalError("init(coder:) has not been implemented") } var name: String? { get { return value(forKey: "name") as? String } set { setValue(newValue!, forKey: "name") } } var classDescription: String? { get { return value(forKey:

Querying shared records in a ckzone in the private database returns nothing

杀马特。学长 韩版系。学妹 提交于 2019-12-24 23:52:07
问题 Swift 4.2 iOS 11.x I must have missed something cause this surely should work. I got this code that queries the private database in a custom zone. It returns nothing despite the fact that I have records there. I added indexes to everything! I also changed the roles in permissions so that any authenticated user could read records. public func cleanUpImages(zone2U:String) { var records2Delete:[CKRecord.ID] = [] let zone2D = CKRecordZone(zoneName: zone2U) let predicate = NSPredicate(value: true)

Unable to share a CKRecord

这一生的挚爱 提交于 2019-12-24 20:32:42
问题 I wrote the code below to share a CKRecord: CKRecordZone *restaurantsZone = [[CKRecordZone alloc] initWithZoneName:@"RestaurantsZone"]; CKRecordID *recordID = [[CKRecordID alloc] initWithRecordName:self.recordName zoneID:restaurantsZone.zoneID]; CKRecord *record = [[CKRecord alloc] initWithRecordType:@"Restaurant" recordID:recordID]; [record setValue:self.restaurant forKey:@"name"]; UICloudSharingController *cloudSharingController = [[UICloudSharingController alloc] initWithPreparationHandler

CloudKit Dashboard not updating

邮差的信 提交于 2019-12-24 18:31:12
问题 I'm making an app to store every users' comments and then dısplay them in my app. (just like a restaurant rating app) However when a user enters a comment and hits submit, nothing seems to appear on dashboard. Every record type is set to queryable yet when I click on query results it gives me the error that I should set my indexes to queryable. Here is my code.(Swift) @IBAction func OnSubmitTouched(_ sender: UIButton) { if (textField.text != ""){ let newComment = CKRecord(recordType: "Comment

Cloudkit Security Roles

放肆的年华 提交于 2019-12-24 16:52:27
问题 The only use I can see for Security Rolls in CloudKit is granting another team member access to the cloudkit Dashboard in order to modify the tables in the dashboard? Is this correct, or am I missing something? Currently I am the only one who can login to the dashboard and I can't add another team Member. I think this is because I am registered as a single developer with Apple? I was hoping to use this to set up some type of security on the public database but it seems that I can't do that

Accessing .recordFields from CKQueryNotification Swift 2

筅森魡賤 提交于 2019-12-24 14:54:41
问题 I get the following error on didReceiveRemoteNotifications if I try to simply print this property, like: let cloudKitNotification = CKNotification(fromRemoteNotificationDictionary: userInfo as! [String : NSObject]) if cloudKitNotification.notificationType == .Query { let queryNotification = cloudKitNotification as! CKQueryNotification print(queryNotification.recordFields) Could not cast value of type '__NSCFDictionary' (0x273119c) to 'CKRecordValue' (0x2763090). If I print the whole