Questions tagged [cknotification]

CKNotification is a component of the cloudkit iOS Developer Library. A CKNotification object represents a push notification.

CKNotification is a component of the cloudkit iOS Developer Library. A CKNotification object represents a push notification.

Notification objects wrap the data associated with a push notification. Use notification objects to wrap recently received push notification data or to fetch notification objects representing already delivered push notifications from a container. In both cases, the information in the notification object tells you what changed. Available in iOS 8.0 and later.

Read the official reference for further details

14 questions
13
votes
3 answers

CKModifyBadgeOperation is deprecated in iOS 11. Anyone know an alternative approach?

I have searched, and I cannot find an example. I have also tried adapting this code (recommended elsewhere (CloudKit won't reset my badge count to 0): func resetBadgeCounter() { let badgeResetOperation = CKModifyBadgeOperation(badgeValue: 0) …
user1739040
  • 143
  • 5
4
votes
2 answers

Cloudkit: CKNotificationInfo badge value never decrease

I set subscription notifications for cloudkit. Here is my code: NSPredicate *predicate = [NSPredicate predicateWithFormat:@"TRUEPREDICATE"]; CKSubscription *subscription = [[CKSubscription alloc] …
user2924482
  • 8,380
  • 23
  • 89
  • 173
2
votes
1 answer

Processing notifications from public, private and shared database in didReceiveRemoteNotification

I process both private and shared database notifications by converting userInfo to CKDatabaseNotification. But I do get public database notifications also in didReceiveRemoteNotification method and Apple template code does not show how to process it…
vrao
  • 545
  • 2
  • 12
  • 33
2
votes
1 answer

cloudkit notifications for a specific field within a record

I have cloudkit notifications working. When someone changes the record, the subscribers are notified. My subscription definition looks like: NSPredicate *searchConditions = [NSPredicate predicateWithFormat:@"%K = %@",…
Thunk
  • 4,099
  • 7
  • 28
  • 47
2
votes
1 answer

How to connect CKQueryNotification to a CKRecord or CKSubsription?

I need a way to connect a CKQueryNotification to a CKRecord or CKSubscription so I can receive updates/inserts/deletes on multiple record types. I'm successfully receiving CKNotifications and this is the payload: { ck = { ce = 2; …
Matt W.
  • 956
  • 9
  • 21
2
votes
2 answers

How to notify another device that a CloudKit record has been updated?

The CKSubscription documentation says: When a record modification causes a subscription to fire, the server sends push notifications to all devices with that subscription except for the one that made the original change to the record. Let's assume I…
Neal
  • 21
  • 3
1
vote
1 answer

Is CKMarkNotificationsReadOperation device specific or app specific?

Does anyone know if marking a CKNotification as read affects all devices or just the device that read the notification? If it affects all devices, then what's the purpose of marking it read if you can just send the previous server change token to…
powertoold
  • 1,593
  • 13
  • 19
1
vote
2 answers

Are previousServerChangeToken for CKFetchNotificationChangesOperation user specific or database specific?

For public CloudKit databases, does anyone know if the data tokens used for previousServerChangeToken when initializing a CKFetchNotificationChangesOperation are: 1) User specific: a data token can only be used by one Apple ID or 2) Database…
powertoold
  • 1,593
  • 13
  • 19
1
vote
1 answer

How is it possible that CKQueryNotification reason is RecordUpdated but recordFields is nil?

println("queryNotification.recordFields.keys: \(queryNotification.recordFields?.keys)") I do not catch how it this log possible? If I get a notification that record was updated, than I need at least one field that was changed, isn't it? Btw I am…
János
  • 32,867
  • 38
  • 193
  • 353
0
votes
1 answer

How to Queue Up Lots of Inbound CloudKit Notifications

Let's say I save 50 records to CloudKit with a CKModifyRecordsOperation like this: let operation = CKModifyRecordsOperation(recordsToSave: records, recordIDsToDelete: nil) operation.savePolicy = .changedKeys operation.modifyRecordsCompletionBlock =…
Clifton Labrum
  • 13,053
  • 9
  • 65
  • 128
0
votes
1 answer

CloudKit Get actual Object from Record ID in OSX

I am trying to use CKSubscription to subscribe to changes. I am following Apple's docs which seems to be very general and incomplete. Link to Apple Doc I have got the point of getting Record ID sent to my app via the didReceiveRemoteNotification…
UKDataGeek
  • 6,338
  • 9
  • 46
  • 63
0
votes
0 answers

Error accessing recordFields in CKQueryNotification

When I access the recordFields on a CKQueryNotification returned from a subscription, I get this error: Could not cast value of type '__NSCFDictionary' (0x1009f0630) to 'CKRecordValue' (0x1009fc050). I process the notification like this: let…
James
  • 851
  • 6
  • 10
0
votes
1 answer

CloudKit: CKOperations don't run when app is suspended

I am listening to remote notifications from CKSubscriptions from a CloudKit public database. I want to handle the case where I receive the notifications while the app is suspended ... I simulate this on my device by running the app using Xcode with…
Z S
  • 7,039
  • 12
  • 53
  • 105
0
votes
1 answer

CloudKit and CKSubscriptions

I'm addressing a very strange issue about CloudKit and push notifications provided by Apple with CKSubscriptions. Firstly, everything is working fine, I'm able to receive a CKNotification, it worked for some days till I made some changes to the…
Progeny
  • 672
  • 1
  • 11
  • 25