Hello. We are facing very silent and hardly replicable issue. All UserDefaults.standard data the application saved and was using to determine the state of app is lost and app behaves as if it was freshly installed.
The issue always occurs only if we leave app on background for long time or if we manually swipe the app from the background apps. In case we swipe, this issue can occur in minutes, hours or up to 2 days by our latest testing.
One important factor is that the app was developed using iOS18 in which issue never occured. Next it was being tested on iOS26 and it did everytime. Any currently available version of iOS26 reported this issue, all the way up to 26.2.1 (23C71). Our application is going through major upgrade of its whole lifecycle and services so it is possible this issue is caused by a bug in development as the production version does not report this issue neither on iOS26 of any version.
The following list contains how we tried to fix this issue but none of which helped.
- App prewarming in the background (postpone all initialization including searching UserDefaults.standard for when isProtectedDataAvailable)
- Calling UserDefaults.standard.synchronize() everytime after saving data despite it is not recomended
- Built app using different SDK's (tested on iOS18 and iOS26 SDK)
- Distributed the app from local machine aswell as on TestFlight itself
We searched through currently opened and closed issues for third-party libraries app uses regarding 'iOS26' and 'UserDefaults', especially those who were added recently with no success.
The structure using which we save data into UserDefaults.standard did not change, we have only added few more settings to save through the lifecycle of the app after update. We estimate the overall increase is merely 30% more of what it used to be in previous version.
Any ideas are much appreciated. We are considering to use different or fully custom ways to store app's settings.