Closed nathany closed 9 years ago
Yeah, this one is a tough one. I was thinking if we made a type alias like so type BadgeCount int
and used sentinel values to distinguish 0
and absence of value. It ended up kind of gross and not ideal.
This seems like closest to semantically correct. :+1:
Yah. I was also thinking of a second field that flags it, and basically having an internal structure and an external API. It's not really any better than needing a pointer to an integer, which I also find kind've gross.
The unfortunate part with merging this change is that it breaks any clients of the library. Hopefully they are using godep.
I don't like this particular solution because it changes the API - and not in a nice way. :frowning:
But this does provide specs for the issue. Badge: 0 and no badge have different behaviours on APNs. Right now it's not possible to clear out the badge and notifications list by sending 0 (Badge is omitempty and 0 is considered empty).