cloudkit

CloudKit share private Container between users

被刻印的时光 ゝ 提交于 2019-12-04 12:03:16
I'm planning to develop an App used to share infos about geographic locations (coordinates, notes, pics), a kind of Treasure Hunt and I did not understand if it is possible, using CloudKit, to share part of a private container between users. If it is, how can I do that? I'd need to create something like Apple does in the Reminders App, where a user can "invite" other users and have a common list to share between them all where everybody can insert or edit stuff. Eventually if it's not possible to do it using CloudKit, can I do that with Parse? Thank you! Data in the private container can not

Increment field value in a CKRecord variable without fetching?

房东的猫 提交于 2019-12-04 11:44:11
I am curious is it somehow possible to increment a field value in a CKRecord variable without fetching? So on client I am not curious about the recent value, I just want to increase whatever be the value is. The reason, operation should be as quick and easy as possible, instead of two message 'stream', I want initiate only one. Unfortunately you can not. You have to read, change and then write the record. Make sure that you use the CKModifyRecordsOperation and leave the savePolicy to CKRecordSaveIfServerRecordUnchanged If you get an error then you could try read and write the record again. 来源:

CloudKit fetch all subscriptions from the current user

有些话、适合烂在心里 提交于 2019-12-04 09:39:21
I manage to save, change and delete records in Apples CloudKit. I even got notifications working with subscriptions, what I can not find out is, how do i list all subscriptions for the current user. Here is my code so far: let operation = CKFetchSubscriptionsOperation() operation.fetchSubscriptionCompletionBlock = { (d, e) -> Void in println("got subscription") if e != nil { println("Error") dump(e) } dump(d) } publicDatabase.addOperation(operation) What I got is: got subscription Error - <CKError 0x14db0ed0: "Invalid Arguments" (12)> #0 - 0 key/value pairs What are the Invalid Arguments ? And

Best way to query references in CloudKit?

China☆狼群 提交于 2019-12-04 07:07:44
Say I have 2 entities in my CloudKit database: - Album - (NSString) title - Photo - (NSString) name - (CKRefrence) album Photos have a CKReference to an Album. This means that 1 album can have many photos (as expected). I have a screen where I want to display all albums, and how many photos are in each album. What is the best way to query for this? If I query for Albums right now, each album knows nothing about its photos. For each of the album object anAlbum, you would form your predicate and query the Photo record type like so: let predicate = NSPredicate(format: "album == %@", anAlbum) let

CREATE operation not permitted

戏子无情 提交于 2019-12-04 05:22:30
问题 I am trying to utilize CloudKit in my iOS application, but when I attempt to create a new record for for a User record type (record type is named Users ), I get this error: <CKError 0x7fb80947ffb0: "Permission Failure" (10/2007); server message = "CREATE operation not permitted"; uuid = 8C4C7B60-E3F4-42FC-9551-D3A76A6FF9D6; container ID = "iCloud.com.jojodmo.Blix"> To create the new record, I am using this code in viewDidLoad() : UserCKManager.create( CloudKitUser( email: "email@website.com",

Stack overflow when defining subscript on CKRecord in Swift

☆樱花仙子☆ 提交于 2019-12-04 03:17:47
问题 This question asks whether one can use subscripting with CKRecord in Swift. While I already knew how to do what the questioner wanted, every permutation of it gives me a stack overflow: subscript(key: String) -> CKRecordValue? { get { return objectForKey(key) as CKRecordValue? } set { setObject(newValue, forKey: key) } } The stack overflow occurs in the getter. (I've never tried the setter, so it may occur there, too.) I've tried implementing with objectForKey: , objectForKeyedSubscript: ,

CloudKit CKSubscription without notifications?

[亡魂溺海] 提交于 2019-12-04 02:22:46
I'm writing a Swift app with CloudKit. When a record is modified in CloudKit by a device, I want the corresponding records to be updated in the local storage of the other devices without displaying a push notification. Do I need to call registerUserNotificationSettings in didFinishLaunchingWithOptions (meaning that the user has to accept the notifications for my app) even if I don't plan to display any push notification? application.registerUserNotificationSettings(UIUserNotificationSettings(forTypes: .Alert, categories: nil)) Yes you do need to call registerUserNotificationSettings even all

The application is missing required entitlement com.apple.developer.icloud-services'

﹥>﹥吖頭↗ 提交于 2019-12-03 23:58:31
问题 I'm using a public iCloud database in my app, which works great and is up on the store. On updating my app to a new version (with Xcode 7 on iOS9) I get a crash on the line : CKContainer * container = [CKContainer containerWithIdentifier:@"iCloud.com.identifier"]; *** Terminating app due to uncaught exception 'CKException', reason: 'The application is missing required entitlement com.apple.developer.icloud-services' This happens ONLY the first launch of the app after updating, and only on

CloudKit - How to share multiple records and retrieve shared records?

痴心易碎 提交于 2019-12-03 21:39:05
I watched last WWDC 2016 What's New with CloudKit to understand how to share records with other users using CKShare Single record sharing: I am able to share and retrieve a single record i.e if xyz@gmail.com has created and shared a single record to abc@gmail.com Multiple records sharing: let's say there are 10 records and xyz@gmail.com wants to share to abc@gmail.com . I am facing the issue when user xyz@gmail.com shares multiple records to user abc@gmail.com What I have tried so far: First I created 3 note records: Note1 Note2 ( set parent as Note1 ) Note3 ( set parent as Note1 ) I shared

How to grant discoverUserInfoWithUserRecordID permission?

懵懂的女人 提交于 2019-12-03 21:29:55
To retrieve actual logged in iCloud user's info via CloudKit, I need to call the discoverUserInfoWithUserRecordID method. Its API says: The user must have granted the CKApplicationPermissionUserDiscoverability permission for this container. How does it work? Swift CKContainer.defaultContainer().requestApplicationPermission(CKApplicationPermissions.PermissionUserDiscoverability, completionHandler: { applicationPermissionStatus, error in // check (applicationPermissionStatus == CKApplicationPermissionStatus.Granted) }) Objective-C [[CKContainer defaultContainer] requestApplicationPermission