UserDefaults and SSO Extensions

Hi

Have a question around extensions and app group capabilities.

I have an existing app using UserDefaults and if I want to introduce an SSO extension; the extension doesn't use or need any of the data created by the app and saved to UserDefaults.

Will the app still have access to the UserDefaults or do I have move to UserDefaults(suiteName: "group.com.YourCompany.YourApp") even if UserDefaults is only used by the app?

Many thanks

Accepted Reply

An app always has access to its own user defaults via the .standard singleton. If you don’t need to share preferences, it’s fine to use that. That doesn’t change if your app is using app groups for some other purpose.

Share and Enjoy

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

  • Thanks for the reply. I assume the UserDefault.standard accessible by the app aren't affected given SSO extensions are configured as of part of an MDM infrastructure

Add a Comment

Replies

An app always has access to its own user defaults via the .standard singleton. If you don’t need to share preferences, it’s fine to use that. That doesn’t change if your app is using app groups for some other purpose.

Share and Enjoy

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

  • Thanks for the reply. I assume the UserDefault.standard accessible by the app aren't affected given SSO extensions are configured as of part of an MDM infrastructure

Add a Comment

I assume the UserDefault.standard accessible by the app aren't affected given SSO extensions are configured as of part of an MDM infrastructure

I’m not super familiar with SSO extensions or MDM but, yeah, I wouldn’t expect those to change this.

Share and Enjoy

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

  • I'm testing some of the app group functionality at the moment and can confirm UserDefault.standard isn't affected by the extension. Simply put, only the app can access UserDefault.standard.

    Happy to open a new thread, but what would you recommend to move files from FileManager.default.urls to FileManager.default.containerURL to support data sharing between the app and extension. In particular, what's the best function to handle the update when a user downloads the latest version of an app. Appreciate any guidance 😃

  • Let's talk about that in a new thread. Tag it with Foundation and Files and Storage so that I see it.

Add a Comment