: Issue with App Group Preferences in iOS Message Extension

I’m encountering an issue while reading/writing shared preferences using UserDefaults with an App Group in my iOS Message Extension. The following error appears in the console:

`Couldn't read values in CFPrefsPlistSource<0x3034e7f80> (Domain: [MyAppGroup], User: kCFPreferencesAnyUser, ByHost: Yes, Container: (null), Contents Need Refresh: Yes): Using kCFPreferencesAnyUser with a container is only allowed for System Containers, detaching from cfprefsd.

I have correctly enabled the App Group in both my containing app and the Message Extension, and I am using UserDefaults(suiteName:) to access shared preferences. However, I keep getting this error when trying to read/write values.

Has anyone encountered this before? How can I properly configure my app group preferences to avoid this issue? Any help would be greatly appreciated!

I am pretty sure that is a noice that can be ignored. See On Log Noise for more information.

If you do see that UserDefaults + App Group container doesn't work in your extension, please share the details, ideally, a minimal project with detailed steps to reproduce the issue, and I'd take a closer look.

Best,
——
Ziqiao Chen
 Worldwide Developer Relations.

Many developers, including myself, are experiencing issues with UserDefaults and App Group containers in Message Filter Extensions on iOS 18. These extensions were working fine in previous versions but no longer function correctly after the update.

Could you confirm whether this issue originates from the iOS system itself, or if there are any changes in iOS 18 that affect the functionality of Message Filter Extensions? I will provide a minimal project with steps to reproduce the problem. Please let us know if there are any updates or recommended workarounds.

Looking forward to your insights.

Best, Mahesh GV

We applied System Integrity Protection to App Group containers on macOS Sequoia 15, as described here, but I don't think that impacts iOS 18 in any way.

I am not sure if message filter extensions have anything special though, as I haven't played with an extension of that kind for a while. If you have a minimal project that reproduces the issue, I'd be interested in taking a look.

Best,
——
Ziqiao Chen
 Worldwide Developer Relations.

Dear Ziqiao,

Thank you for your response. As requested, I have created a minimal project that reproduces the issue. Since external links are not permitted on the forums, please let me know the best way to share the project with you (e.g., email or an alternative upload method).

Issue Recap:

  • The Message Filter Extension is not being triggered at all in iOS 18.
  • The handle(_:context:completion:) method inside ILMessageFilterQueryHandling never gets called when an SMS arrives.
  • The same implementation worked fine in iOS 17 and earlier, but it is not functioning after the update to iOS 18.
  • Several other developers are also experiencing this issue and have reported it in Apple Developer forums:

Steps to Reproduce:

  1. Install the minimal project on a real iOS 18 device (not just a simulator).
  2. Enable the Message Filter Extension via Settings → Messages → Unknown & Spam.
  3. Check the logs while receiving an SMS.
  4. Observe that the filtering method never executes, meaning the extension is not being triggered.

Additional Context:

  • I have already updated to macOS Sequoia 15.
  • The issue persists on both real devices and simulators running iOS 18.
  • The extension is correctly set up with App Groups and required entitlements, but it is not receiving any SMS filtering events.

Questions:

  1. Has there been any change in iOS 18 that affects the behavior of Message Filter Extensions?
  2. Are there additional entitlements or configurations required for these extensions in iOS 18?
  3. Is there an alternative way to debug or verify whether the system is actually attempting to invoke the extension?

I appreciate your time in reviewing this issue and look forward to your insights.

Best regards,

Mahesh GV

Written by MaheshGubbi in 827384022
Since external links are not permitted on the forums

DevForums does allow you to post arbitrary links, you just have to do that in the clear. See tip 14 in Quinn’s Top Ten DevForums Tips.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Hi, I've created a minimal project reproducing the issue: Minimal project. Link: https://drive.google.com/file/d/1p5sfXqt-ES6eeTw9V3c4sZGw3GPXWQ0s/view?usp=sharing

The Message Filter Extension is not triggered in iOS 18—handle(:context:completion:) never gets called on SMS arrival. It was working fine in iOS 17 but stopped functioning after the update.

Could you check the minimal project and help with the following questions?

Are there any changes in iOS 18 affecting Message Filter Extensions? Are new entitlements or configurations required? Any known solutions or alternative approaches to achieve this? Looking forward to your insights.

Best, Mahesh GV

: Issue with App Group Preferences in iOS Message Extension
 
 
Q