Post not yet marked as solved
Post marked as unsolved with 0 replies, 221 views
Hi,
I'm using Cloud Kit and I'm able to save and fetch records from a custom zone in the private database. I can add subscriptions to the database, and I see them in iCloud Dashboard, but I can't get my (Mac) app to register for the notifications.
In my app delegate I have:
func applicationDidFinishLaunching(_ aNotification: Notification) {
NSApplication.shared.registerForRemoteNotifications()
}
func application(_ application: NSApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
print("Registered for remote notifications")
}
func application(_ application: NSApplication, didFailToRegisterForRemoteNotificationsWithError error: Error) {
print("Failed to register for remote notifications")
}
func application(_ application: NSApplication, didReceiveRemoteNotification userInfo: [String : Any]) {
print("Received icloud notification!")
}
None of application(:didRegisterForRemoteNotificationsWithDeviceToken deviceToken:), application(:didFailToRegisterForRemoteNotificationsWithError error:) or application(:didReceiveRemoteNotification userInfo: are ever called.
I can't find any guidance in the docs, can anyone point out what I am missing?
Thanks,