Skip to content
This repository has been archived by the owner on Jun 6, 2023. It is now read-only.

Payload and device token validations #14

Merged
merged 2 commits into from
Jan 9, 2016
Merged

Payload and device token validations #14

merged 2 commits into from
Jan 9, 2016

Conversation

nathany
Copy link
Contributor

@nathany nathany commented Jan 9, 2016

These validations are brought over from a closed source library. All of these validations are opt-in. They aren't performed automatically.

  • APS notifications can contain just custom data without a badge or body, but Buford has no way of knowing if custom data will be added later.
  • Passbook notifications are completely empty, but it doesn't really make sense to use APS or even serialize JSON when you can just use PushBytes with {}.
  • Newsstand notifications are empty except for ContentAvailable. APS won't validate a payload like this right now. Newsstand isn't really a thing anymore, but maybe there are other cases where only ContentAvailable should be set? This could be another case where serialization can be skipped.
  • ContentAvailable-only notifications must be used with the LowPriority header, but these are set in different packages so no attempt is made to validate this.
  • Device tokens may get larger in the future. In 2016, [device tokens] may be growing up to 100 bytes. #13

These validations should probably be verified against the Apple documentation to make sure they are still the correct thing to do.

I haven't done anything to validate the push Headers yet, such as the UUID format for the ID or that the expiration is in the future.

@curtisallen
Copy link
Contributor

Awesome LGTM
thanks!

curtisallen added a commit that referenced this pull request Jan 9, 2016
Payload and device token validations
@curtisallen curtisallen merged commit b70e6fa into master Jan 9, 2016
@curtisallen curtisallen deleted the valid branch January 9, 2016 15:06
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants