Respond to push notifications related to your app’s complications, file providers, and VoIP services using PushKit.

Posts under PushKit tag

41 Posts
Sort by:

Post

Replies

Boosts

Views

Activity

Complication PushKit is not received in the background
It is received fine when the watch app is in the foreground. Code sample: import Foundation import PushKit final class PushNotificationProvider: NSObject { let registry = PKPushRegistry(queue: nil) override init() { super.init() registry.delegate = self registry.desiredPushTypes = [.complication] } func pushRegistry(_ registry: PKPushRegistry, didUpdate pushCredentials: PKPushCredentials, for type: PKPushType) { Log("token received") } func pushRegistry(_ registry: PKPushRegistry, didReceiveIncomingPushWith payload: PKPushPayload, for type: PKPushType, completion: @escaping () -> Void) { Log("push received") completion() } } Watch app: import SwiftUI @main struct XX_Watch_App: App { @WKApplicationDelegateAdaptor var appDelegate: XXWearableAppDelegate private let push = PushNotificationProvider() var body: some Scene { WindowGroup { AppView(...) } } }
3
0
122
5d