Pushes being received on the phone with a push type of None, but apns-push-type is being set

A server is sending pushes to my app and when I look at what the iPhone is logging, it says:

Received remote notification request 48E4-17A1 [ waking: 0, hasAlertContent: 1, hasSound: 0 hasBadge: 0 hasContentAvailable: 0 hasMutableContent: 1 pushType: None]

Note that the pushType is None.

However the server is setting apns-push-type to "alert" and the push payload contains an alert section

alert =     {
    body = "i am a body";
    subtitle = "the subTitle";
    title = "Hello there";
};

This is causing problems when trying to suppress the notification (using a notification service extension and the com.apple.developer.usernotifications.filtering entitlement). The iPhone is logging:

Notification filtering will not be allowed because the push type 'None' is not 'Alert'

Why does the OS think the push doesn't have a type when the server is setting apns-push-type?

The first thing to suspect is that the request is malformed and the apns-push-type header is not being set correctly. You may want to start by checking the actual request that is being sent, and not relying on server settings or source code.

You can also try using command line tools as described here: https://developer.apple.com/documentation/usernotifications/sending_push_notifications_using_command-line_tools If you are able to send a push with the correct push type that way, then the issue will be on the push provider server side.

Pushes being received on the phone with a push type of None, but apns-push-type is being set
 
 
Q