cloudkit

Private data sharing using CloudKit

三世轮回 提交于 2020-01-11 18:54:13
问题 Is there a straightforward way to share private data between two or more users using CloudKit? Public and private date are obvious, but there doesn't seem to be a way to allow a group of users to organize their own silo to share data amongst themselves without making it available to all the other users of the system and to the app developer. I have an academic collaboration app in mind but the simplest example would be private messaging between two users. I guess one could try to build a

Trying to modify ckrecord in swift

心已入冬 提交于 2020-01-07 08:35:32
问题 I want the users' location to be updated in cloudkit but my code just save a new record every time. How can the existing record be modified or replaced by the new one? func locationManager(manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) { let location = locations.last let center = CLLocationCoordinate2D(latitude: location!.coordinate.latitude, longitude: location!.coordinate.longitude) let region = MKCoordinateRegion(center: center, span: MKCoordinateSpan(latitudeDelta

Alternatives to UPDATE notification that does not work

旧城冷巷雨未停 提交于 2020-01-07 03:25:07
问题 UPDATE notification stopped working. What workaround do you have, until Apple figures out something? CKFetchNotificationChangesOperation sometimes does not return UPDATE, DELETE notifications CloudKit push notifications on record update stopped working https://forums.developer.apple.com/thread/7288 My quick fix, that in every minute, and when user triggers UIRefreshControl , then I downloading all the records that were modified since the last update. It works. But I have a better idea in my

CloudKit + no valid aps-environment entitlement error

对着背影说爱祢 提交于 2020-01-06 14:57:18
问题 I try to use CloudKit subscriptions in my app, but didReceiveRemoteNotification not get triggered. I saved CKSubscription to CloudKit . To be sure they exists, when app starts, I plot them out, like: <CKSubscription: 0x15576310; ; Query Subscription: recordType=DailyVote, predicate=TRUEPREDICATE, subscriptionOptions=7, subscriptionID=1FA456A6-9BA5-411D-97B9-1EB57121A5D0, zoneID=(null)> predicate: TRUEPREDICATE subscriptionType: (Enum Value) subscriptionOptions: C.CKSubscriptionOptions I try

How to create a share with CloudKit's CKShare?

Deadly 提交于 2020-01-04 09:39:58
问题 I'm studying the new CKShare that Apple released this year and I have some questions with it. I was trying to follow the WWDC's "What's new in CloudKit" video but part of the code isn't working anymore in Xcode. What I'm trying to do is: the user will enter his name and phone and after clicking a UIButton , will share with a specific person. Here is the code: class ViewController: UIViewController, UICloudSharingControllerDelegate { @IBOutlet weak var nome: UITextField! @IBOutlet weak var

Move record from development to production in CloudKit?

自作多情 提交于 2020-01-03 16:42:51
问题 I have plenty of record manually preloaded to CloudKit but in the development environment. When I deployed development environment, records were not moved into production environment. It is really annoying. Any easy way to move records? 回答1: There is no easy way to migrate your records. You cannot link an app both to production and to development. The only workaround is downloading all records from development and storing those records in a file and then switch to production and upload the

cloudkit: how to access main user's attributes?

大城市里の小女人 提交于 2020-01-03 00:50:54
问题 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? 回答1: You first have to find out what the current loged in userId is. You can do that by executing the

CKFetchRecordChangesOperation returns no records

南笙酒味 提交于 2020-01-01 19:21:12
问题 CKFetchRecordChangesOperation in the simplified method below does not return any records. I call it with a nil, to initially get all the records, but it only returns the server token. However, if I use CKQuery I get all the records correctly. What am I missing? func fetchChangedRecords(token :CKServerChangeToken?) { println("\(__FUNCTION__) token: \(token)") let zoneID = CKRecordZoneID(zoneName: kMyZone, ownerName: CKOwnerDefaultName) var op = CKFetchRecordChangesOperation(recordZoneID:

Best way to query references in CloudKit?

杀马特。学长 韩版系。学妹 提交于 2020-01-01 11:14:17
问题 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. 回答1: For each of the album object anAlbum, you would form your

CloudKit - NSPredicate for finding all records that contain specified CKReference in a reference list

余生长醉 提交于 2020-01-01 00:45:14
问题 I am working on a CloudKit backed app with a Users record type that has a "following" reference list attribute. I am trying to construct a query to get every user that is following a specified user (i.e. those users in which the specified user appears as an entry in the following reference list). I am currently trying to construct my NSPredicate for the CKQuery as such: NSPredicate *predicate = [NSPredicate predicateWithFormat:@"%@ IN following", [[CKReference alloc] initWithRecordID