CloudKit iOS 9.0 didReceiveRemoteNotification 在 iOS 9.3 发布后未调用

CloudKit iOS 9.0 didReceiveRemoteNotification not called after iOS 9.3 released

我有一台装有 iOS 9.0 的 iPod Touch,在 iOS 9.3 发布后未收到 CloudKit CKSubscription 推送通知。

我的 iPad 和 iOS 9.3 可以很好地接收通知,使用相同的应用程序构建。

有人知道这里发生了什么吗?某些 CloudKit 版本是否不再向旧版本推送通知?

当我在我的 iPod Touch 上删除并重新安装应用程序时,我点击 "Allow" 以允许推送通知,但是如果我在我的 CloudKit 仪表板中进行任何记录更改,只有我的 iPad 收到推送通知,我的 iPod Touch 甚至没有调用 didReceiveRemoteNotification。

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]) {
}

解决方案相当棘手。在我的 Xcode 项目中,有一个 *.entitlements 文件,其中包含我的应用程序图标的名称(显示在设备上)。但是,我的项目名称与此 *.entitlements 文件不同:

我的文件: ABC.entitlements(我的应用在设备上显示为 ABC)

我的项目名称: XYZ

所以我尝试将权利文件的名称更改为 XYZ.entitlements,但是 Xcode 警告我已经有一个名为 XYZ.entitlements 的文件。事实证明,我的 Supporting Files 文件夹中还有另一个 *.entitlements 文件。此权利文件没有任何 iCloud 设置。

实际上,这应该无关紧要,因为在我的构建设置中,权利文件路径设置为 ABC.entitlements,但出于某种原因,对于我的 iPod Touch 的 iOS 9.0.1,它似乎正在使用 XYZ.entitlements 文件(我的假设)。

我从我的项目中删除了 XYZ.entitlements 文件,并且还在我的目标成员中包含了 ABC.entitlements 文件。之后,我的 iPod Touch 能够再次收到 CloudKit 通知。

感谢您的帮助!