NSUserDefaults values lost in neighbour app from iOS app group on device restart

I have two iOS applications which are configured for the same app group in the iTunes and in the projects' files.


In the WriteData.app, I've created a user defaults with suit name:

let groupDefaults = UserDefaults(suiteName: "AppGroupDefaults")

and write some values there. In the ReadData.app I read the data from the groupDefaults.


In the following case, I'm unable to read values for my custom keys from the groupDefaults:

Make sure WriteApp and ReadApp are uninstalled from a test device.

  1. Install WriteApp to the device, launch it and store some values within the groupDefaults.
  2. Restart the device.
  3. Install ReadApp and launch it. Read the values from the groupDefaults.

The values stored in the 1st step will be unavailable in the 3rd step until you launch the WriteApp. All I can see are the system values and keys.

What may cause the issue? The values are definitely not reset during WriteApp launch and in any other case everything works fine.