App initiates a App group based UserDefaults within the willFinishLaunchingWithOptions
method and the same reference are used throughout the app life cycle
+ (NSUserDefaults *)appGroupUserDefaults
{
if (_appGroupUserDefaults == nil)
{
NSString *appGroupIdentifier = [NSString stringWithFormat:@"group.%@",[[NSBundle mainBundle] bundleIdentifier]];
NSUserDefaults *groupDefaults = [[NSUserDefaults standardUserDefaults] initWithSuiteName:appGroupIdentifier];
if(groupDefaults != nil)
{
NSLog(@"[DB_ENCRYPTION] appGroupUserDefaults initialised");
_appGroupUserDefaults = groupDefaults;
}
else
{
NSLog(@"<ALA_ERROR>: [CCF-OS] [DB_ENCRYPTION] %s Unable to create NSUSerDefaults with groupIdentifier", __func__);
_appGroupUserDefaults = [NSUserDefaults standardUserDefaults];
}
}
return _appGroupUserDefaults;
}
Doesn't have any issues on accessing the values but seen the below console error:
Couldn't read values in CFPrefsPlistSource<0x103eedb00> (Domain: group.com.kodiak.InstaPoC, User: kCFPreferencesAnyUser, ByHost: Yes, Container: (null), Contents Need Refresh: Yes): Using kCFPreferencesAnyUser with a container is only allowed for System Containers, detaching from cfprefsd
Does it require any action here ?