I have a VoIP app, now try to implement the new method which support the "PKVoIPPushMetadata" in iOS 26.4.
Code as below:
/// iOS 26.4+ (SDK with `PKVoIPPushMetadata`): prefer this path for VoIP per Apple; completion is `@Sendable` on supported SDKs.
@available(iOS 26.4, *)
func pushRegistry(_ registry: PKPushRegistry, didReceiveIncomingVoIPPushWith payload: PKPushPayload, metadata: PKVoIPPushMetadata, withCompletionHandler completion: @escaping @Sendable () -> Void) {
print("willtest: didReceiveIncomingVoIPPushWith: metadata=\(metadata)")
handleVoIPPush(payload: payload, metadataMustReport: metadata.mustReport, completion: completion)
}
func pushRegistry(_ registry: PKPushRegistry, didReceiveIncomingPushWith payload: PKPushPayload, for type: PKPushType, completion: @escaping () -> Void) {
print("willtest: didReceiveIncomingPushWith: PKPushType=\(type)")
handleVoIPPush(payload: payload, metadataMustReport: nil, completion: completion)
}
But the voip push only goes to the old method on my iOS26.4 device(iPhone17).
And it will go to the new method after I delete the old method.
So how can I use this method in my app? I must support iOS16+ versions.
0
0
19