Troubleshoot Issues in iOS Service Extensions

This guide provides a structured approach to troubleshooting common issues in iOS Service Extensions, ensuring seamless integration and functionality.

Embedded binary signing errors occur when you disable automatic signing and your Main Target and Notification Service Extension are signed with different certificates. If you encounter build failures or runtime issues related to code signing, follow these troubleshooting steps.

  1. Make sure that the certificate you used for the parent app (main app) is the same as the one you used for the embedded extension.
  2. Use the same distribution certificate for both targets.
  1. On Xcode, navigate to Preferences > Accounts and make sure you selected the correct provisioning profile.
  2. Make sure that both the parent app and the embedded binary share the same provisioning profile, and includes the right entitlements for both.
  3. In case of manual profiles, download and install the latest provisioning profiles from the Apple Developer website.
  1. In the Xcode project navigator, select the embedded binary.
  2. Go to General > Signing & Capabilities.
  3. Make sure Automatically manage signing is checked. If not, manually set the correct Team, Signing Certificate, and Provisioning Profile.
  4. Make sure the embedded binary uses the same certificate and provisioning profile as the main app.
  1. Make sure both the main app target and the embedded binary target are set to use the same provisioning profile and the same signing certificate.
  2. Check each target’s Signing & Capabilities tab to verify this.

Make sure both your app and its extension are set up to use the same App Group. Check the entitlements file and the App Groups setting in both the app and extension targets.

A common source of errors in Service Extensions is incorrect Info.plist settings. To avoid potential issues, review these key configurations.

Make sure the NSExtension key in your extension's Info.plist is set up correctly. For the Notification Service Extension, make sure that NSExtensionPrincipalClass is properly set. If you're using Swift, prefix it with $(PRODUCT_MODULE_NAME) to link to the Swift class.

Make sure that the SF_MARKETINGCLOUD_APP_GROUP_KEY key in the Info.plist of your extension is set to the correct value.

To make sure your Notification Service Extension functions correctly with the SDK, verify these configurations.

Make sure your NotificationService class inherits from SFMCNotificationService. Incorrect inheritance can cause the extension to not work properly.

Enable debug-level logging using the sfmcProvideConfig() method to help debug any issues when setting up the SDK.

Notification Service Extension has a limited time to handle notifications. Make sure your code doesn't exceed these limits. For more information, see the official documentation on Apple Developer.

Service extensions can have memory issues or use too many resources. Use Xcode’s Instruments (like Allocations and Leaks) to monitor memory usage and stay within limits.