APNs not delivering messages with null in the body

We have noticed that remote notifications with null in the JSON body are not delivered to our macOS app.

For example, when the JSON body of the remote notification is

{"aps":{"alert":"test"},"customData":null}

APNs endpoint responds with 200 OK, but the message is not received by the application via

- (void)application:(NSApplication *)application didReceiveRemoteNotification:(NSDictionary<NSString *,id> *)userInfo

This issue also reproduces with a JSON body like:

{"a":"b","c":{"d":"e","f":null}}

Please be advised to remove such fields from your messages.

In the meantime, I have submitted a feedback at FB12086979 (APNs not delivering messages with null in the body)

APNs not delivering messages with null in the body
 
 
Q