ios – Error: System token needs to be a hex string on System Token Validator


What I’m finally attempting to do is replace a LiveActivity utilizing a push notification, and so to me the very first step is having the ability to ship a push notification from the Push Notification Console to my system.

I’m at the moment utilizing a simulator system, and my app is organized as follows:

  • Essential goal has bundle id com.nick.predominant
  • Widget goal has bundle id com.nick.predominant.widget

That is how I’m trying to get my token:

do {
        let Exercise = attempt Exercise<Attributes>.request(
            attributes: Attributes2,
            contentState: initialContentState,
            pushType: .token)

        Job {
            for await pushToken in deliveryActivity.pushTokenUpdates {
                let pushTokenString = pushToken.cut back("") { $0 + String(format: "%02x", $1) }

                print("pushTokenString: (pushTokenString)")
                
            }
        }
    } catch (let error) {
        print("Error requesting Dwell Exercise (error.localizedDescription)")
        
    }

When it runs it does print out a token from print("pushTokenString: (pushTokenString)"), and that is what I’m trying to make use of on the push notification console. I’ve tried the System Token Validator on the push notification console and once I put the token to examine it I all the time get the error: Error: System token needs to be a hex string. I additionally tried to make use of the ship function of the push notification console choosing the completely different bundle ID’s and every produces this error when it’s tried:

{
  "code": 400,
  "message": "bad-request",
  "purpose": "Invalid push token",
  "requestUuid": "53f450a0-1160-4be3-aa37-bbd65ba79e58"
}

Any concepts/options on what I’m lacking?

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles