From c0f16f15660cad89f99214c56682e027ad56e890 Mon Sep 17 00:00:00 2001 From: David Stephens Date: Wed, 7 Jan 2026 17:27:21 +0000 Subject: [PATCH 1/3] Add 'widgets' to NotificationPushType As per Apple's documentation: https://developer.apple.com/documentation/widgetkit/updating-widgets-with-widgetkit-push-notifications?changes=_3 --- index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.d.ts b/index.d.ts index ced99b46..15e34b60 100644 --- a/index.d.ts +++ b/index.d.ts @@ -267,7 +267,7 @@ export class MultiProvider extends EventEmitter { shutdown(callback?: () => void): Promise; } -export type NotificationPushType = 'background' | 'alert' | 'voip' | 'pushtotalk' | 'liveactivity' | 'location' | 'complication' | 'fileprovider' | 'mdm'; +export type NotificationPushType = 'background' | 'alert' | 'voip' | 'pushtotalk' | 'liveactivity' | 'location' | 'complication' | 'fileprovider' | 'mdm' | 'widgets'; export type ChannelAction = 'create' | 'read' | 'readAll' | 'delete'; From ab3724dc47768a9679ddf0e86cbecd442a5bba83 Mon Sep 17 00:00:00 2001 From: David Stephens Date: Thu, 8 Jan 2026 01:50:46 +0000 Subject: [PATCH 2/3] Add 'content-changed' property to APS dict in index.d.ts Required for sending Widget update notifications --- index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/index.d.ts b/index.d.ts index 15e34b60..1fbc6447 100644 --- a/index.d.ts +++ b/index.d.ts @@ -120,6 +120,7 @@ interface Aps { badge?: number sound?: string | ApsSound "content-available"?: undefined | 1 + "content-changed"?: undefined | true "mutable-content"?: undefined | 1 "url-args"?: string[] category?: string From 29d1ec4e13c38cca7a1f1a1fb482ada4538255c6 Mon Sep 17 00:00:00 2001 From: David Stephens Date: Wed, 1 Apr 2026 23:51:13 +0100 Subject: [PATCH 3/3] Expose `content-changed` from aps dict as `contentChanged` property and add tests --- index.d.ts | 4 ++++ lib/notification/apsProperties.js | 8 ++++++++ lib/notification/index.js | 1 + test/notification/apsProperties.js | 32 ++++++++++++++++++++++++++++++ 4 files changed, 45 insertions(+) diff --git a/index.d.ts b/index.d.ts index 1fbc6447..3cb375dd 100644 --- a/index.d.ts +++ b/index.d.ts @@ -367,6 +367,10 @@ export class Notification { * */ public mutableContent: boolean; + /** + * Setting this to true will specify "content-changed" in the payload when it is compiled + */ + public contentChanged: boolean; /** * The value to specify for the `mdm` field where applicable. */ diff --git a/lib/notification/apsProperties.js b/lib/notification/apsProperties.js index b333bff1..55117f31 100644 --- a/lib/notification/apsProperties.js +++ b/lib/notification/apsProperties.js @@ -145,6 +145,14 @@ module.exports = { } }, + set contentChanged(value) { + if (value === true || value === 1) { + this.aps['content-changed'] = true; + } else { + this.aps['content-changed'] = undefined; + } + }, + set mdm(value) { this._mdm = value; }, diff --git a/lib/notification/index.js b/lib/notification/index.js index 17230441..dedc459d 100644 --- a/lib/notification/index.js +++ b/lib/notification/index.js @@ -45,6 +45,7 @@ Notification.prototype = require('./apsProperties'); 'sound', 'contentAvailable', 'mutableContent', + 'contentChanged', 'mdm', 'urlArgs', 'category', diff --git a/test/notification/apsProperties.js b/test/notification/apsProperties.js index 2f7f611e..20bb32c8 100644 --- a/test/notification/apsProperties.js +++ b/test/notification/apsProperties.js @@ -761,6 +761,38 @@ describe('Notification', function () { }); }); + describe('content-changed', function () { + it('defaults to undefined', function () { + expect(compiledOutput()).to.not.have.nested.deep.property('aps.content-changed'); + }); + + it('can be set to a boolean value', function () { + note.contentChanged = true; + + expect(compiledOutput()).to.have.nested.deep.property('aps.content-changed', true); + }); + + it('can be set to `1`', function () { + note.contentChanged = 1; + + expect(compiledOutput()).to.have.nested.deep.property('aps.content-changed', true); + }); + + it('can be set to undefined', function () { + note.contentChanged = true; + note.contentChanged = undefined; + + expect(compiledOutput()).to.not.have.nested.deep.property('aps.content-changed'); + }); + + describe('setContentChanged', function () { + it('is chainable', function () { + expect(note.setContentChanged(true)).to.equal(note); + expect(compiledOutput()).to.have.nested.deep.property('aps.content-changed', true); + }); + }); + }); + describe('mdm', function () { it('defaults to undefined', function () { expect(compiledOutput()).to.not.have.nested.deep.property('mdm');