0

We are successfully integrated two application with app group enablement. However when trying to retrieve the date from the Userdefault in IOS version 10 and above we are getting the following error :

Failed to read values in CFPrefsPlistSource<0x170107c50> (Domain:"Group name", User: kCFPreferencesAnyUser, ByHost: Yes, Container: (null)): Using kCFPreferencesAnyUser with a container is only allowed for System Containers, detaching from cfprefsd

We are using the following code to retrieve the data :

NSUserDefaults *shared = [[NSUserDefaults standardUserDefaults] initWithSuiteName:groupname];    
[shared synchronize];
NSString *jsonString = [shared stringForKey:@"key"];

But we tried in ios version 9, we are successfully retrieving the data.

Please help.

Rohit Poudel
  • 1,793
  • 2
  • 20
  • 24

1 Answers1

1

Try like this

NSString *suiteName = @"your group bundle id";
_userDefalut = [[NSUserDefaults alloc] initWithSuiteName:suiteName];

Or you can go to the group sandbox path check more details.

NSString *suiteName = @"your group bundle id";
NSString *groupPath = [[NSFileManager defaultManager] containerURLForSecurityApplicationGroupIdentifier:suiteName]
Kumar KL
  • 15,315
  • 9
  • 38
  • 60
iticle
  • 131
  • 1
  • 4