Notification Service Extension Not Working

I've added a Notification Service Extension as a target to my React Native iOS app following Apple's official documentation. After completing all the setup steps as outlined in the documentation, the notification titles remain unchanged - notifications are arriving without any modifications, suggesting the extension isn't functioning properly.Testing Details:

Sending notifications via Apple Push Notification Console Tested on iPhone 16 Pro Max (physical device) Tested on iPhone 15 Pro simulator Both show the same issue - no title modifications

The extension appears to not be executing at all.

Has anyone encountered similar issues with Notification Service Extensions in React Native projects, or can suggest troubleshooting steps to verify the extension is properly configured and running?

Answered by Engineer in 856003022

Unfortunately, "appears to not be executing" could be for a lot of reasons, and you will need to first debug and understand what the cause of this NSE "not working" is, so you can fix it.

The reasons the NSE fails to modify the message could be:

  • it crashes at launch
  • it crashes while modifying or exits early without setting the content and calling contentHandler()
  • it goes over the memory and time limits and is terminated by the system
  • it is trying to access on-disk objects that are not available (perhaps due to security settings) and fails
  • the reentrancy of the NSE causes problems if any global variables/singletons/shared objects are not designed accordingly that the same NSE process could be used for multiple notifications
  • it is unable to be started by the system for some reason (the Console log will show those issues)
  • the extension is not configured or built correctly in your application bundle
  • notification is not delivered to the device
  • there is a problem with the notification payload that gets rejected before NSE is engaged
  • notification permissions are revoked
  • push type is not alert
  • the modification of the message is trying to make the alert text empty
  • notification payload is missing the "mutable-content:1" entry

So, you will need to debug your app, extension, and build to find out the reason the NSE is not running or not doing what it is supposed to do.

Once you do that, it will be possible to fix whatever is wrong with it.


Argun Tekant /  DTS Engineer / Core Technologies

Accepted Answer

Unfortunately, "appears to not be executing" could be for a lot of reasons, and you will need to first debug and understand what the cause of this NSE "not working" is, so you can fix it.

The reasons the NSE fails to modify the message could be:

  • it crashes at launch
  • it crashes while modifying or exits early without setting the content and calling contentHandler()
  • it goes over the memory and time limits and is terminated by the system
  • it is trying to access on-disk objects that are not available (perhaps due to security settings) and fails
  • the reentrancy of the NSE causes problems if any global variables/singletons/shared objects are not designed accordingly that the same NSE process could be used for multiple notifications
  • it is unable to be started by the system for some reason (the Console log will show those issues)
  • the extension is not configured or built correctly in your application bundle
  • notification is not delivered to the device
  • there is a problem with the notification payload that gets rejected before NSE is engaged
  • notification permissions are revoked
  • push type is not alert
  • the modification of the message is trying to make the alert text empty
  • notification payload is missing the "mutable-content:1" entry

So, you will need to debug your app, extension, and build to find out the reason the NSE is not running or not doing what it is supposed to do.

Once you do that, it will be possible to fix whatever is wrong with it.


Argun Tekant /  DTS Engineer / Core Technologies

Notification Service Extension Not Working
 
 
Q