问题
I am using MacCatalyst to port an iOS/iPadOS app to MacOS. The app uses CloudKit and functions in all ways except one: the UIApplicationDelegate
method, didReceiveRemoteNotification
, is not called on the MacOS version when a CloudKit update is submitted from another device
Things that do work in the app:
- Submitting
CKDatabaseOperation
s including updates and subscriptions to CloudKit - Manually retrieving database updates from CloudKit
UIApplicationDelegate
methoddidRegisterForRemoteNotificationsWithDeviceToken
fires andUIApplication.isRegisteredForRemoteNotifications
returns true when callingUIApplication.registerForRemoteNotifications
- Setting the
CKSubscription.NotificationInfo
to invoke an alert notification which displays properly in MacOS UNUserNotificationCenterDelegate
method,willPresent
, when an alert notification is invoked and the app is in the foregrounddidReceiveRemoteNotification
on iOS and iPad (physical devices)
Has anyone had UIApplicationDelegate
method, didReceiveRemoteNotification
, called when using MacCatalyst?
Update:
The app did eventually fire the didReceiveRemoteNotification
method 30 minutes after an update was sent, but on other updates, the method is not fired even after hours. Any ideas?
来源:https://stackoverflow.com/questions/59778113/bug-check-cloudkit-maccatalyst-didreceiveremotenotification