Cloudkit Push Notifications on Record Update Stopped Working

CloudKit push notification subscription not working

Fixed it by resetting the development environment. Hopefully same thing doesn't happen on prod.
Sample Image

Not receiving CloudKit push notifications for Custom Record Zone on the Mac

I think it's fixed with macOS Sierra. Working for me now.

Edit:
Oh wow: just noticed that I (!) asked this question 1,5y ago. :)

CloudKit Not Sending Update Notifications

The solution appears to be to use an info object with shouldSendContentAvailable = true, like this:

let info = CKNotificationInfo()
info.shouldSendContentAvailable = true
subscription.notificationInfo = info

That has solved it for me. It causes didReceiveRemoteNotification: to fire, without any user visible notification appearing. So it's a silent notification, as desired, and it's actually arriving, as desired.

If I leave subscription.notificationInfo nil the app is never notified of changes. But with an [effectively silent] info object I get the desired results.

Cloudkit is not sending push notifications

You seem to be doing everything right. Two things I can think of:

  1. Are you sure you are registering for remote notifications? I can't see the call to application.registerForRemoteNotifications() anywhere. I am assuming you forgot to paste it here.

  2. Have you tried to delete the subscription in the panel and recreate it? I have had issues where registering the same subscription multiple times with different notificationInfo would break it and it would stop firing.

Cloudkit PushNotifications not veing delivered, but subscription created in Schema

The reason the push notifications weren't coming to my device was because I was using only 1 iphone. You can't send a push notification that "a new record was created" to the device that made the record. As soon as I switched over to using the simulator to make the Record, my physical device started getting the push notifications. Both simulator and physical device were signed into the same icloud account.

So the process looks like:

  1. App installed on physical device (Signed into iCloud). Subscribe to zone changes in physical device.
  2. Launch the app on the simulator (Signed into iCloud).
  3. Save a record on the simulator
  4. Push Notification will appear on the physical device.


Related Topics



Leave a reply



Submit