-
Notifications
You must be signed in to change notification settings - Fork 126
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
Don't send badge value #22
Comments
I think I prefer the int pointer version. @anachronistic, what about you? |
A third option exists which would be to treat badge numbers as such:
Just would need to heavily document that if you want to clear the badge number, you should set the badge to < 0 rather than 0. This doesn't match one to one with Apple's spec but would alleviate the issue without changing the Payload interface. |
As an update, ended up going with a typed solution and implementing json Marshaller interface (https://github.com/joekarl/go-libapns/blob/ccef56a3e7cb9f0f0da4add6da007a23ad0da46d/badge_number.go) props to @themartorana for that one |
Is it currently possible to not send a value for badge count? It seems to be the badge count is always sent since when it isn't explicitly set to something the library sets it to -1. I realize the issue here is differentiating between an empty badge count and a badge count set to zero. Two possible solutions would be to either make badge count an int pointer or create a method/flag on the payload that signals that the user wants to exclude the badge count. Thoughts?
The text was updated successfully, but these errors were encountered: