Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

applyPushToken logic is not correct #2

Open
godenasai opened this issue Feb 16, 2017 · 0 comments
Open

applyPushToken logic is not correct #2

godenasai opened this issue Feb 16, 2017 · 0 comments

Comments

@godenasai
Copy link

I see the logic of extracting the pushToken from Foundation.Data is not correct. Since you are getting the description of the deviceToken (deviceToken.description.trimmingCharac......), it is always storing it as "32bytes".

I found the below code working.

var tokenString = ""

    for i in 0..<deviceToken.count {
        tokenString += String(format: "%02.2hhx", arguments: [deviceToken[i]])
    }
    
    print("Device Token:", tokenString)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant