Hi Mr eskimo,
Yes, I shared my data between my app and my app extenstion via a shared app group. When I deploy it directly to device, It work well and I can get data when I open app via app extension. But when I distribute it and export it to iPA or push it to test flight, it doesn't work, I can't get data I need, it seem connect with other SuiteName. I guest that the app group was automatic changed when in distribution mode. But I don't know what it is.
NOTICE: I'm just facing this problem after recently update provisioning.
Below is example of my source code, please help me to check it.
```
#define GROUPID @"group.com.****"
std::string NVDataManagerNative::getString(const std::string& key, const std::string& def)
{
NSUserDefaults *ud = [[NSUserDefaults alloc] initWithSuiteName:GROUPID];
if(ud == nil){
ud = [NSUserDefaults standardUserDefaults];
}
NSString *ret = [ud stringForKey:convertNSString(key)];
if (nil == ret) {
return def;
}
return [ret UTF8String];
}
bool NVDataManagerNative::putString(const std::string& key, const std::string& value)
{
NSUserDefaults *ud = [[NSUserDefaults alloc] initWithSuiteName:GROUPID];
if(ud == nil){
ud = [NSUserDefaults standardUserDefaults];
}
[ud setObject:convertNSString(value) forKey:convertNSString(key)];
[ud synchronize];
return true;
}