cloudkit

CKNotificationInfo soundName does not work

不羁的心 提交于 2019-12-31 04:30:09
问题 Sbuscription is create like below. It works, but no sound generated, why? Doc says: if you specify the string default for this property, the system plays the default alert sound. let s2 = CKSubscription(recordType: recordType, predicate: NSPredicate(format: "destination = %@", CKReference(recordID: CKRecordID(recordName: loggedInUserSettingRecordName!), action: .DeleteSelf)), options: .FiresOnRecordCreation) s2.notificationInfo = CKNotificationInfo() s2.notificationInfo.alertBody = " " s2

How do I access security role in cloudkit

我的梦境 提交于 2019-12-31 04:03:15
问题 I am building an app with Role based Security. I have built my Record Types (Projects, Accounts, HistoryLog, Financial, Customer, etc) in Cloudkit Dashboard, and I have created Security Roles as well. I have roles named: Executive and DeptManager. I have assigned to the Record Types the appropriate access by Role. I have also assigned to the user in the special Record Type "Users" the role of either Executive or DeptManager. I have successfully accessed and manipulated data in the Record

How to get the actual quota for CloudKit?

旧时模样 提交于 2019-12-31 01:56:07
问题 Im using Cloudkit and the private database to store some files to iCloud and sync between iOS und OSX. Now I wanted to implement something, the user can see how much space is left in his iCloud without leaving the app and look in the preferences. But I cant't find any information how to get this data. The whole CloutKit Framework reference has no object or method that gives me this information. Because the private database uses the normal iCloud quota of the user, I could work around by

CKError localizedDescription

折月煮酒 提交于 2019-12-30 18:56:07
问题 Aim I would like to display the CKError encountered to the user in the app as an alert. So I would like to extract the string from the error that can be displayed to the user. Note: This question is not about UI code to display. Just want to extract a meaningful string from the error. I tried to use localizedDescription but it doesn't seem to contain an appropriate string Code: Given below are the attempts I made: po error <CKError 0x1c464cea0: "Network Unavailable" (3/NSURLErrorDomain:-1009)

Is there anyway to import bulk data through the CloudKit Dashboard?

喜夏-厌秋 提交于 2019-12-30 11:02:24
问题 I see how to create record types and add records one at a time in the CloudKit dashboard. I want to try adding a few hundred records for testing. Is there any way to import CSV or JSON files into dashboard? 回答1: No there is not. You have to create an import mechanism in your app. (Or you could use the CloudKit api from another app/website) 回答2: On one hand you can only create records one at a time in the CloudKit dashboard. On the other hand, you can import a CSV or JSON file as a CKAsset

CKQueryOperation not returning error when device offline

余生颓废 提交于 2019-12-30 07:59:26
问题 I am trying to use CKQueryOperation , rather then performQuery on my CloudKit database. Both work, but when using a CKQueryOperation I am not getting an error when the device is offline, but I do when using performQuery Here is the bare bones my performQuery example, database is my CKDatabase database.performQuery(q, inZoneWithID: nil) { (records:[CKRecord]?, error:NSError?) in if error != nil { print(error!.localizedDescription) return } } An error is given when the device is offline,

CKQueryOperation not returning error when device offline

痴心易碎 提交于 2019-12-30 07:59:05
问题 I am trying to use CKQueryOperation , rather then performQuery on my CloudKit database. Both work, but when using a CKQueryOperation I am not getting an error when the device is offline, but I do when using performQuery Here is the bare bones my performQuery example, database is my CKDatabase database.performQuery(q, inZoneWithID: nil) { (records:[CKRecord]?, error:NSError?) in if error != nil { print(error!.localizedDescription) return } } An error is given when the device is offline,

How to properly send an image to CloudKit as CKAsset?

你离开我真会死。 提交于 2019-12-29 07:40:12
问题 I have an image (UIImage and it's url too) and I'm trying to send it to CloudKit as a CKAsset but I'm having this error: Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Non-file URL' . Here is the code: override func viewDidLoad() { super.viewDidLoad() send2Cloud() } func send2Cloud() { let newUser = CKRecord(recordType: "User") let url = NSURL(string: self.photoURL) let asset = CKAsset(fileURL: url!) newUser["name"] = self.name newUser["photo"] = asset let

Saving Modified Data in CloudKit

こ雲淡風輕ζ 提交于 2019-12-29 05:32:32
问题 I have been testing out CloudKit as i wish to release an app using it when the release of iOS8 occurs. It seems simple enough to save data using the code below: CKRecordID * recordID = [[CKRecordID alloc] initWithRecordName:@"basicRecord"]; CKRecord * record = [[CKRecord alloc] initWithRecordType:@"basicRecordType" recordID:recordID]; [record setValue:@"defaultValue" forKey:@"defaultKey"]; CKDatabase *database = [[CKContainer defaultContainer] publicCloudDatabase]; [database saveRecord:record

Seed and maintain CloudKit public database without requiring iCloud login?

女生的网名这么多〃 提交于 2019-12-28 07:09:33
问题 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