AndrewBarba / apns2

Node client for connecting to Apple's Push Notification Service using the new HTTP/2 protocol with JSON web tokens
MIT License
115 stars 31 forks source link

APNS-expiration header not added when value is 0 #88

Closed LarsDanau closed 1 week ago

LarsDanau commented 1 week ago

According to Apple documentation it should be possible to add an apns-expiration header with value: 0

If the value is 0, APNs attempts to deliver the notification only once and doesn’t store it.

Issue is located at https://github.com/AndrewBarba/apns2/blob/740f5d9b48247a9755f1a520a4a4f88e817e6996/src/apns.ts#L97

Because the value is 0, it will not enter the statement, hence not adding the expiration header

AndrewBarba commented 1 week ago

Pushing a new version: https://github.com/AndrewBarba/apns2/commit/a0c453462923187702461c3a3d89022361833bfc

AndrewBarba commented 1 week ago

Released https://github.com/AndrewBarba/apns2/releases/tag/11.7.1