I have an app on the App Store that works with CloudKit, and remote notifications work just fine there. If a user modifies a record, it triggers a push notification on his/her other devices, and AppDelegate's
didReceiveRemoteNotification
is called.In the dev environment, I've added some new entities, but in my testing, the push notifications aren't being received anymore. Basically
didReceiveRemoteNotification
isn't being called at all.Some important notes:
- this only doesn't work on iOS ... on my Mac app, pointing to the same CloudKit container, the remote notifications are received correctly, so it's nothing to do with how the CloudKit subscription is created or modified (I haven't changed anything in that regards anyways)
- I do call
as before, andregisterForRemoteNotifications
is called as expecteddidRegisterForRemoteNotificationsWithDeviceToken
- I am testing on a device, not a simulator
- Background App Refresh is enabled on the device
- Notifications are allowed for the app
- The CKNotificationInfo object is created with
= YES, andshouldSendContentAvailable
= @"" (not a nil string)alertBody
I dug into the device's console logs, using Xcode, and found that the console does output something that suggests that the device is receiving the push notification, but it's not being passed onto the app for some reason:
default 18:02:47.127117 -0800 SpringBoard Received incoming message on topic com.apple.icloud-container.com.ztest.myapp at priority 10
default 18:02:47.133708 -0800 SpringBoard [com.ztest.myapp] Received remote notification request 0E01-5E4D [ waking: 0, hasAlertContent: 0, hasSound: 0 hasBadge: 0 hasContentAvailable: 1 hasMutableContent: 0 pushType: Alert]
default 18:02:47.133780 -0800 SpringBoard [com.ztest.myapp] Process delivery of push notification 0E01-5E4D
error 18:02:47.133851 -0800 SpringBoard [com.ztest.myapp] NOT requesting DUET deliver content-availateston-notifiying push notification 0E01-5E4D [pushType: Alert willNotifyUser: 0]
error 18:02:47.133997 -0800 SpringBoard [com.ztest.myapp] NOT delivering non-notifying push notification 0E01-5E4D [pushType: Alert willNotifyUser: 0]
default 18:02:47.134053 -0800 SpringBoard Getting effectiveSectionInfo for section identifier: com.zsquare.ijournal
default 18:02:47.134099 -0800 SpringBoard [com.ztest.myapp] Getting effective section info
default 18:02:47.135743 -0800 SpringBoard [com.ztest.myapp] Got effective section info [ hasResult: 1 ]
I'm not really sure, but it seems like the one line here that shows 'error' with "NOT delivering non-notifying push notification" would explain the problem. But I'm not sure what is causing this. Could it just be the dev environment being flaky? I've tried this on multiple iOS devices now, so it's not just a problem with this one device.
Can anyone suggest any reasons why the push notification isn't being received in the app, or suggest some way to test this and narrow down what's happening?
Thanks.