diff --git a/keyserver/src/push/send.js b/keyserver/src/push/send.js --- a/keyserver/src/push/send.js +++ b/keyserver/src/push/send.js @@ -513,6 +513,11 @@ if (copyWithMessageInfos.length() <= apnMaxNotificationPayloadByteSize) { notification.payload.messageInfos = messageInfos; } + if (notification.length() > apnMaxNotificationPayloadByteSize) { + console.warn( + 'iOS notification exceeds size limit, even with messageInfos omitted', + ); + } return notification; } @@ -565,6 +570,15 @@ ) { return copyWithMessageInfos; } + + if ( + Buffer.byteLength(JSON.stringify(notification)) > + fcmMaxNotificationPayloadByteSize + ) { + console.warn( + 'Android notification exceeds size limit, even with messageInfos omitted', + ); + } return notification; }