MacCatalyst版本上未收到CKQueryNotification [英] CKQueryNotification not received on MacCatalyst build

查看:118
本文介绍了MacCatalyst版本上未收到CKQueryNotification的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用通常在iOS或iPadOS上从 CKQuerySubscription 收到 CKQueryNotification ,但MacCatalyst具有相同的捆绑包ID(从Xcode 11.6生成),它甚至都不会收到 CKQueryNotification 甚至是

  func应用程序(_ application :UIApplication,didRegisterForRemoteNotificationsWithDeviceToken deviceToken:Data)

在应用启动时会正确调用-每当CloudKit发生记录更改时,该方法

  func应用程序(_应用程序:UIApplication,
didReceiveRemoteNotification userInfo:[AnyHashable:Any],
fetchCompletionHandlercompleteHandler:@转义(UIBackgroundFetchResult)-> Swift.Void)

从不触发MacCatalyst版本,而立即在iOS上触发。 / p>

任何想法为何?苹果论坛上有一个话题,但是还没有找到解决方案: https://developer.apple .com / forums / thread / 125069

解决方案

对于在开发应用程序时也遇到此问题的任何人,我决定无论如何都要发布该应用程序,然后发现在Mac上的App Store版本中,催化剂应用程序实际上几乎可以立即收到通知。因此,这似乎是CloudKit的调试环境错误。


My app receives CKQueryNotification from CKQuerySubscription normally on iOS or iPadOS, but with MacCatalyst with the same bundle ID (generated from Xcode 11.6), it never receives CKQueryNotification even tho

func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data)

gets called properly upon app launch - whenever there's a record change on CloudKit, the method

func application(_ application: UIApplication,
                 didReceiveRemoteNotification userInfo: [AnyHashable : Any],
                 fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Swift.Void)

never fires on the MacCatalyst build, whereas it fires immediately on iOS.

Any ideas why? There's a thread on Apple forum but don't see a solution yet: https://developer.apple.com/forums/thread/125069

解决方案

For anyone also experiencing this problem while developing your app, I decided to publish the app anyways and found out that in the App Store version, on Mac the catalyst app actually could get the notification almost immediately. So it seems to be a debug environment bug for CloudKit.

这篇关于MacCatalyst版本上未收到CKQueryNotification的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆