Pushkit voip get token device

Hello I want to implement a VOIP pushkit but can not get the token device. This is because appdelegate.swift.


func pushRegistry(_ registry: PKPushRegistry, didUpdate credentials: PKPushCredentials, forType type: PKPushType) {

/

/

if type == PKPushType.voIP {

let tokenData = credentials.token

print("TOKEN: \(tokenData)")

}

}


As a result, output in the console and get 32 bytes of the token is not present. All instructions and an example of what I found in Google must check the token but I for some reason 32 bytes

Hello!

Did you find a solution for this?


I get exactly the same results.


I have this:


func pushRegistry(_ registry: PKPushRegistry, didUpdate credentials: PKPushCredentials, forType type: PKPushType) {

print("voip token: \(String(data: credentials.token, encoding: String.Encoding.utf8) as String!)")

NSLog("voip token: \(credentials.token)")

}


it prints:

voip token: nil

voip token: 32 bytes


It would be really nice if someone could help on this as I'm in desperate need for help!


Thanks,
Muff

Hey. Use this instead.


let deviceToken: String = deviceToken.reduce("", {$0 + String(format: "%02X", $1) })
Pushkit voip get token device
 
 
Q