CloudKit iOS 9.0 didReceiveRemoteNotification not called after iOS 9.3

I have an iPod Touch with iOS 9.0 that does not receive PushKitCKKKK notifications after the release of iOS 9.3.

My iPad with iOS 9.3 receives notifications just fine using the same build application.

Does anyone know what is going on here? Can some versions of CloudKit no longer send notifications to older versions?

When I uninstall and reinstall the application on my iPod Touch, I click "Allow" to allow push notifications, but if I make any changes to the entries on my CloudKit panel, only my iPad will receive a push notification, and didReceiveRemoteNotification is didn't even call my iPod Touch.

func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { // Register for push notifications let notificationSettings = UIUserNotificationSettings(forTypes: UIUserNotificationType.Alert, categories: nil) application.registerUserNotificationSettings(notificationSettings) application.registerForRemoteNotifications() return true } func application(application: UIApplication, didReceiveRemoteNotification userInfo: [NSObject : AnyObject]) { } 
+5
source share
1 answer

The decision was rather complicated. In my Xcode project there was a * .entitlements file in which was the name of my application (as shown on the device). However, my project name is different from this * .entitlements file:

My file: ABC.entitlements (my application displays as ABC on the device)

My project name: XYZ

So, I tried to change the name of the permissions file to XYZ.entitlements, but Xcode gave me a warning that there is already a file called XYZ.entitlements. Turns out there was another * .entitlements file in my "Supported Files" folder. There were no iCloud settings in this rights file.

It doesn't really matter, because in my build settings, the path to the permissions files is ABC.entitlements, but for some reason, it seemed to use XYZ with my iPod Touch iOS 9.0.1. the file is right (my guess).

I deleted the XYZ.entitlements file from my project, and also included the ABC.entitlements file in my target membership. After that, my iPod Touch was again able to receive CloudKit notifications.

Thank you for your help!

0
source

Source: https://habr.com/ru/post/1246887/


All Articles