diff --git a/node_modules/react-native-mmkv-storage/ios/MMKVStorage.m b/node_modules/react-native-mmkv-storage/ios/MMKVStorage.m index 2875bda..8235771 100644 --- a/node_modules/react-native-mmkv-storage/ios/MMKVStorage.m +++ b/node_modules/react-native-mmkv-storage/ios/MMKVStorage.m @@ -45,10 +45,10 @@ - (id)init { self = [super init]; if (self) { - NSArray *paths = NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, YES); - NSString *libraryPath = (NSString *) [paths firstObject]; - NSString *rootDir = [libraryPath stringByAppendingPathComponent:@"mmkv"]; - [MMKV initializeMMKV:rootDir]; + NSBundle *bundle = [NSBundle mainBundle]; + NSString *APP_GROUP_ID = [bundle objectForInfoDictionaryKey:@"AppGroupIdentifier"]; + NSString *groupDir = [[NSFileManager defaultManager] containerURLForSecurityApplicationGroupIdentifier:APP_GROUP_ID].path; + [MMKV initializeMMKV:nil groupDir:groupDir logLevel:MMKVLogInfo]; secureStorage = [[SecureStorage alloc]init]; IdStore = [[IDStore alloc] initWithMMKV:[MMKV mmkvWithID:@"mmkvIdStore"]];