Giter Club home page Giter Club logo

Comments (3)

andrei-m-code avatar andrei-m-code commented on July 22, 2024 1

@co-dax thank you for your feedback! It all makes perfect sense! The serializer issues were somewhat expected by me because we switched from Newtonsoft to System.Text.Json, so yeah, null values :). And I only made it serialize using lower case. Expecting that some people might want to change serialization rules or go back to Newtonsoft, I added a way to switch the serializer. So it should be all covered. And yeah it's v4.x.x, it's supposed to break things lol. Anyways.. I'll keep this question open for a little to see if anyone else has something to say about the matter.

from net-core-push-notifications.

andrei-m-code avatar andrei-m-code commented on July 22, 2024

Good question. You can pass a different serializer into the senders. Just override it here:

protected virtual JsonSerializerOptions GetJsonSerializerOptions()

The motivation behind having it camel case is that firebase and apple expects lower case fields so it's easier to just have everything converted to lower case..

More input on this is appreciated

from net-core-push-notifications.

co-dax avatar co-dax commented on July 22, 2024

Yeah, it makes sense making everything uniform with regards to letter casing now it is only question if that outweights the fact that one is not getting at the device what he sends from the backend meaning if someone sends PascalCase then he might have a good reason for that. For example I am using C# and Angular and I have a plugin that is automatically creating all TypeScript files from the frontend based on the entities from the backend so for the for the message.data object I use a class with PascalCase properties and on the frontend I have (automatically generated as I mentioned above) TypeScript interface with the identic PascalCase properties but as it is I am getting camelCase propeperties.

It is not a big deal though.

As for passing the serializer, yes this a viable option and by the way I already noticed we can pass a serialier when I was getting an error when some of the payload fields were null (I think it was in iOS context) so I was trying to find a way to exclude properties with "null" values completely from serialization as FCM was reporting errors if I send an object that has a property value "null" so in that context I noticed we can pass a custom serializer...thus what I have on my mind is to create a wrapper or a proxy method/class to this library that would alway send payloads to FCM by using a custom serializer that has been setup so that it excludes from serialization propertis that have NULL values. I hope I am clear

from net-core-push-notifications.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.