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

Move to Frame based packets, support message priority #38

Merged

Conversation

jebu
Copy link
Contributor

@jebu jebu commented Dec 8, 2014

This pull request support new message format for apns with frames.

It also adds an extra field onto the apns record for message priority.

Added a test case which test this low priority message

Fixes issue #30

@@ -26,4 +26,5 @@
badge = none :: none | integer(),
sound = none :: none | apns:apns_str(),
apns_extra = [] :: none | [{atom(), integer()|boolean()|string()}],
extra = [] :: proplists:proplist()}).
extra = [] :: proplists:proplist(),
priority = 10 :: integer()}).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Considering that, according to Apple...

The remote notification must trigger an alert, sound, or badge on the device. It is an error to use this priority for a push that contains only the content-available key.

... I think the default value should be 5

@elbrujohalcon
Copy link
Member

@jebu please as well rebase or merge from master. Thanks.

@jebu
Copy link
Contributor Author

jebu commented Dec 9, 2014

As per https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/LegacyFormat.html#//apple_ref/doc/uid/TP40008194-CH105-SW1 a priority of 10 is assumed for all legacy messages. So preserving the default of 10 for compatibility. I've also set a priority of 5 for send_content_available/2 to prevent errors for pure content_available pushes.

Rebased to master as per request.

@elbrujohalcon
Copy link
Member

Fair enough

elbrujohalcon pushed a commit that referenced this pull request Dec 9, 2014
Move to Frame based packets, support message priority
@elbrujohalcon elbrujohalcon merged commit 925dc79 into inaka:master Dec 9, 2014
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

Successfully merging this pull request may close these issues.

None yet

2 participants