Repository navigation
Nothing changes at runtime. This is a major release because the package now ships its own TypeScript types, which are stricter than @types/node-pushnotifications.
TypeScript types
Types are included in the package. Remove @types/node-pushnotifications. They need TypeScript 5.5 or later and @types/node.
They cover topic and condition destinations and the 7.0 results. Checking method on a result narrows its entries, for example to a FirebaseError with code for FCM, or the subscription and statusCode for Web Push.
Code written against the old types may hit these errors:
send()always returns a promise, also with a callback.gcmandmpnssettings are gone.apntakes node-apn's options, so old keys it ignores, such asvoipandcacheLength, are rejected.settings.fcmneedsserviceAccountKeyorcredential, andsettings.wnsneedsnotificationMethod. Without them, sends always failed.- A string
datais only accepted for Web Push destinations. - An FCM topic or condition destination needs
type: 'fcm', and can't also have anid.
Fixes
- A string
alertwas sent to APNs, and to iOS through FCM, as{ "0": "H", "1": "e", ... }. It's now sent as the alert text. - A string
customwas split the same way for APNs, the FCMdataand ADM. It's now sent as{ message }, as Android already did. - WNS with an access token: when
wnsthrew, the rejection could go unhandled and exit the process. A throw in the WNS sender also no longer skips the ADM and Web Push sends of the same call.send()still rejects with the error.
Full Changelog: 7.0.0...8.0.0