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

Remove JSON.Net dependency #663

Open
dylanvdmerwe opened this issue Mar 24, 2016 · 1 comment
Open

Remove JSON.Net dependency #663

dylanvdmerwe opened this issue Mar 24, 2016 · 1 comment
Milestone

Comments

@dylanvdmerwe
Copy link
Contributor

What version of PushSharp are you using?

4.x

Describe your issue:

Is there really a need to have a dependency on the JSON.Net library anymore now that developers are responsible for creating their own message payloads?

Currently for GCM and Apns:
1

2

The Data and Payload properties respectively expect a JObject. This creates a hard dependency on the JSON.Net library.

I firmly believe it should be up to the developers to create a proper payload and that it is their responsibility to serialize the JSON correctly. As such, the Notification classes should just take a string object instead of a JObect.

Benefits of this:

  • Removing hard dependencies on external libs. Reduces version conflicts, binary size, etc.
  • Allows developers to make use of their own serializers like ServiceStack or Jil (or JSON.Net if they so chose)
@Redth Redth added this to the 5.0.0 milestone Mar 24, 2016
@Redth
Copy link
Owner

Redth commented Mar 24, 2016

Yeah i've been giving this some thought. To be honest the only real reason it was included in 3.x+ was in case the fluent helper methods made it back in, but they have not, and will not, so I think your proposal makes sense.

If anything, eventually another package will be made to expose some helpers for building notification payloads, and that helper package may be more opinionated on the use of a serializer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants