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

Add support for windows raw notifications (in json form) #238

Merged
merged 1 commit into from
Feb 2, 2016

Conversation

mseppae
Copy link
Contributor

@mseppae mseppae commented Jan 22, 2016

Added some helpful information to get going with the Windows notifications.

@mseppae
Copy link
Contributor Author

mseppae commented Jan 22, 2016

Oh man travis, haha.

@aried3r
Copy link
Member

aried3r commented Jan 22, 2016

Yeah, there's something weird going on with Travis wrt to Ruby 2.3.0. Rebuilding it fixes it.

@mseppae mseppae changed the title Update README.md regarding Windows setup Add support for windows raw notifications (in json form) Jan 29, 2016
@mseppae
Copy link
Contributor Author

mseppae commented Jan 29, 2016

Windows raw notification support finished. No more commits coming.

@aried3r
Copy link
Member

aried3r commented Jan 29, 2016

Great, thanks! I sadly cannot judge if this works since I've no way to test this myself, but it looks good, judging from the documentation.

Do you think you could squash your commits a bit?

@aried3r
Copy link
Member

aried3r commented Jan 29, 2016

It seems a payload cannot exceed 5KB, could you add a validation and specs for this? I think the other specs have it somewhere.

See https://msdn.microsoft.com/en-us/library/windows/apps/hh761463.aspx#recommendations

@mseppae
Copy link
Contributor Author

mseppae commented Feb 1, 2016

Added the validation and squashed the commit to a single commit.
This is the code we currently use for our windows phone notifications, so I can confirm that it works.

module Wns
class RawNotification < Rpush::Client::ActiveRecord::Notification
validates_with Rpush::Client::ActiveModel::PayloadDataSizeValidator,
limit: 5000
Copy link
Member

Choose a reason for hiding this comment

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

Do you think they mean 5KB with base 10 (5 * 10^3 = 5000) and not 5KiB as in 5 * 2^10 = 5120 byte?

- The raw notification supports only json data, since the data model
  enforces hash.
- Improved readme for Windows setup.
@mseppae
Copy link
Contributor Author

mseppae commented Feb 2, 2016

The payload limit is 2 based not 10, makes sense. Thanks for catching it.
Made sure by manually sending one byte too long payload.

aried3r added a commit that referenced this pull request Feb 2, 2016
Add support for windows raw notifications (in json form)
@aried3r aried3r merged commit 1b855cf into rpush:master Feb 2, 2016
Adrian1707 pushed a commit to Adrian1707/rpush that referenced this pull request Apr 24, 2024
Add support for windows raw notifications (in json form)
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