HomeiOS Developmentios - Error: Gadget token ought to be a hex string on...

ios – Error: Gadget token ought to be a hex string on Gadget Token Validator


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

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

  • Predominant goal has bundle id com.nick.fundamental
  • Widget goal has bundle id com.nick.fundamental.widget

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

do {
        let Exercise = strive 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 Gadget Token Validator on the push notification console and once I put the token to test it I all the time get the error: Error: Gadget token ought to be a hex string. I additionally tried to make use of the ship characteristic of the push notification console choosing the totally different bundle ID’s and every produces this error when it’s tried:

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

Any concepts/solutions on what I’m lacking?

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments