What is the expected behavior for a notification service extension if the user has not been prompted for requestAuthorization()

If an iOS application has a notification service extension which gets sent a push, but the user has not been prompted for notification authorization via requestAuthorization() then what is the expected behavior?

Will the push get delivered to the NSE but the resulting notification not displayed? Or will the push not get delivered at all to the NSE?

Answered by Engineer in 857287022

The NSE will be executed ONLY for notifications that will be visually presented to the user (unless the app has the notification filtering entitlement).

Because of this, the following conditions are required for the NSE to launch:

  • apns-push-type must be alert
  • Payload contains the alert key
  • Notifications must be "on" for the device
  • Notifications must be "on" for the app
  • App must have notifications authorization
  • User must not have turned off the visibility of the app's notifications
  • If the device is locked "show notification content" must be on
  • App must not have been hidden

Argun Tekant /  DTS Engineer / Core Technologies

The NSE will be executed ONLY for notifications that will be visually presented to the user (unless the app has the notification filtering entitlement).

Because of this, the following conditions are required for the NSE to launch:

  • apns-push-type must be alert
  • Payload contains the alert key
  • Notifications must be "on" for the device
  • Notifications must be "on" for the app
  • App must have notifications authorization
  • User must not have turned off the visibility of the app's notifications
  • If the device is locked "show notification content" must be on
  • App must not have been hidden

Argun Tekant /  DTS Engineer / Core Technologies

@Argun Tekant

Thank you.

In my case the NSE has the filtering entitlement, how does that change the list of pre-conditions?

What is the expected behavior for a notification service extension if the user has not been prompted for requestAuthorization()
 
 
Q