App Group data sharing does not work sometimes between HostApp and Service extension.

Hi There, My app is a legacy project built with Objective C. The host app shared data with the service extension by using

NSUserDefaults *userDefault = [[NSUserDefaults alloc] initWithSuiteName:@"group.com.myapp.project"];

and it worked until a customer recently reported a bug (iOS 18.6). After debugging, I found that data sharing from the host app to the service extension was not working correctly.

The host app updated a field's value, but the service still used the old or stale value, causing the issue.

HostApp saved info

2026-06-01 13:44:07.020 [INFO] (VMP)(ThreadID:  0x10a85c000): "Saved Vomo information {
    "EXT_AP_IP" = 1c28af0f9d73;
    "EXT_PING_DND" = 0;
    "EXT_PING_USER_NAME" = aaa08AA541F8;
    "EXT_SERIAL_ACK_TIME" = "2026-06-01 20:44:07 +0000";
    "EXT_SERIAL_NO" = 689;
    "EXT_SERVER_NAME" = "10.xxx.xxx.182";
    "EXT_VOICE_LOGIN" = 1;
}"

Service extension read value:

2026-06-01 13:46:09.678 [INFO] (VMP) - (EXTENSION)(ThreadID:  0x1050a41d0): "start Vomo with Server: [10.xxx.xxx.79] and userName [aaa08AA541F8]"

I can see the value shared from host app is:

10.xxx.xxx.182, but service extension still took the stale value 10.xxx.xxx.79

First I thought it is synchronized issue, however, apple deprecated those API,

CFPreferencesAppSynchronize((__bridge CFStringRef)@"group.com.myexample.project"); How to ensure the shared value successfully delivered to service extension?

Thanks.

Are you seeing reports of this from just this one user?


Regardless, I suspect that you’d be better off not storing this value in user defaults. User defaults is, as the name suggests, intended for user preferences. If some data is critical to the operation of your product — and that certainly seems to be the case here — it’s better to store it in a file that you manage directly. And if you want to share that file from your app to your appex, you can put it in the container for the app group you already have. Use -[NSFileManager containerURLForSecurityApplicationGroupIdentifier:] to get that container’s location on disk.

Share and Enjoy

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

App Group data sharing does not work sometimes between HostApp and Service extension.
 
 
Q