iOs15 beta - Private Relay impacting iOS App UserDefaults

On iOS 15 beta (iOS 15 beta 6 & previous beta) with private relay enabled, my mobile app wipes out UserDefaults data which is causing sign in issues (both manual and biometric) after a day or so after signing in to the app and then backgrounding the app on iOS 15. 

I've see some tweets where some banking apps appears to have a similar issue where their biometric token is getting wiped every few days when private relay is enabled. These app issues seem to only occur when private relay is enabled.

Ivor Carcamo 🏎💨 🚓 🏁 (@Ivor_Carcamo) Tweeted: @isiosstable iOS 15 beta, very stable release. Only issues are with apps themselves. I think that private relay cause apps like Chase and Capital One to require sign in authentication repeatedly. Hopefully next beta resolves or the app developers update their apps. https://twitter.com/Ivor_Carcamo/status/1417638377369833480?s=20

Any insight you could provide or help in narrowing our focus would be helpful and greatly appreciated as we’d like to resolve/mitigate this issue before the iOS 15 general audience release so our iOS mobile app users who upgrade to iOS 15 do not experience it.

On iOS 15 beta (iOS 15 beta 6 & previous beta) with private relay enabled, my mobile app wipes out UserDefaults data which is causing sign in issues (both manual and biometric) after a day or so after signing in to the app and then backgrounding the app on iOS 15.

Why would the presence of iCloud Private Relay being enabled wipe out your UserDefaults data? To test this out, are you able to setup a blank app that just reads and writes standard strings to your UserDefaults with Private Relay enabled? If this does not work then this should be captured as a bug.

From there, once we have validated that there is no issues with UserDefaults we can move on to other issues that may be happening.

Matt Eaton
DTS Engineering, CoreOS
meaton3@apple.com

My customers who installed ios 15.0(iPhone 11) & 15.0.1(iPhone 12 pro) have the same problems with UserDefaults which had been wiped out a few hours later after the launch of the app.

please make sure to call UserDefaults only after - appDidFinishLaunching. If you still see the issue amd are using UserDefaults.standard, then try creating a new instance of UserDefaults with your own suitename and use that instead of standard UserDefaults.

We're experiencing the same issue with one of our apps. I'm not sure whether it's related to the Private Relay. Our temporary solution was to replace UserDefaults with our implementation for the time being.

Other similar threads:

We also experiencing the same issue on our apps. All the users who are updated to iOS 15 reporting that they have to follow same initializing path again and again which stored in user defaults that they have completed the initializing steps or not. Can dose anyone found a solution for this ?

We also experiencing the same issue on our apps. All the users who are updated to iOS 15 reporting that they have to follow same initializing path again and again which stored in user defaults that they have completed the initializing steps or not.

Has there been any link to iCloud Private Relay been found here? I do not see how iCloud Private Relay would affect User Defaults at all.

Matt Eaton
DTS Engineering, CoreOS
meaton3@apple.com

In the end, the issue turned out not to be related to Private Relay at all. It was caused by a combination of iOS 15 changes to app startup and app entitlements. See this answer for more info.

iOs15 beta - Private Relay impacting iOS App UserDefaults
 
 
Q