Comments (8)
I think another point that can be arguable is using Jackson library instead of json-simple in that optimization process.
from pushy.
@okohub Can you elaborate? Why would that help?
from pushy.
ApnsBuilder is complicated. There are lots of things in a one "builder" class. Creating a JSON from builder result is also complicated i think. First of all, using a better library for JSON serializing and dividing core part to POJOs will help developers to improve pushy. Jackson is very powerful at POJOs. You don't have to check attribute is existing or not for serializing, for example.
from pushy.
You don't have to check attribute is existing or not for serializing, for example.
The APNs payload is a tricky beast. In some cases, these things are all interpreted differently by the receiving device:
- An attribute is present and has a non-
null
value - An attribute is present and its value is
null
- An attribute is not present
Jackson (or other libraries) that work by serializing POJOs deprive us of the expressive flexibility we need to reach all of those cases (i.e. there isn't a good way to differentiate between "present and null" and "not present").
from pushy.
Just an idea that when builder is called maybe the length+key length shall be calculated on the spot.
For example, builder.badge(10) increase length by 5(badge) + 1":" + 2(10). And consider the {} together, when build() is called the length shall be evaluated immediately, cause the key and symbols is predefined.
from pushy.
I've been looking through changelogs while updating our dependency and seen this:
Jackson (or other libraries) that work by serializing POJOs deprive us of the expressive flexibility we need to reach all of those cases (i.e. there isn't a good way to differentiate between "present and null" and "not present").
Jackson is not limited to pojo processing mode: there are other modes, such as Tree Model. Take a look at the 'Constructing Tree Model instances from Scratch' section.
from pushy.
FWIW, we switched to Gson a while ago.
from pushy.
Yeah, sorry, totally didn't see the date of that comment.
from pushy.
Related Issues (20)
- return success when send notifacation after uninstalling app HOT 1
- I use Pushy to push the message,then I get "success=true",but the phone not responding HOT 2
- couple of Live Activity issues: stale-date is missing, and relevance-score can now have a value greater than 1.0 HOT 2
- Native SSL provider is available; will use native provider. HOT 4
- ApnsChannelPool java.io.IOException "Failed to create channel - Connection reset by peer" HOT 2
- Network is unreachable: `api.push.apple.com/2620:149:208:4308:0:0:0:a:443` HOT 13
- Missing "start" enumeration com.eatthepath.pushy.apns.util.LiveActivityEvent HOT 2
- add attributes-type and attributes to the payloadbuilder HOT 2
- Not able to use LiveActivityEvent class in the depenedcy HOT 2
- The issue of not being able to recognize PushType and DeliveryPriority from version 0.15.3 and onwards. HOT 1
- Connection exception occurred, but Pushy still used it HOT 2
- 如果连接时抛出 SslHandshakeTimeoutException 异常,那么 ApnsChannelPool pendingCreateChannelFutures 会一直被占有 HOT 7
- Wrong serialization of the object in JsonSerializer HOT 3
- Memory Leak HOT 1
- io.netty.handler.codec.http2.Http2Exception$StreamException: Stream closed before write could take place HOT 1
- Allow methods to not require passing a privateKeyPassword HOT 1
- 0.15.4 with jdk 8 error HOT 2
- UnknownHostException (Not caused by IPv6) jdk17 pushy 0.15.4 Dig can be resolved to. HOT 4
- How to implement VoIP Notification using Pushy HOT 4
- Request spending a long time when the certificate expires HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pushy.