mattermost-mobile/patches/react-native-mmkv-storage+0.6.11.patch
Elias Nahum 5ea470a235
V1 dependencies and bump to RN 0.67.2 (#5908)
* update dependencies

* eslint fixes

* Upgrade to RN 67

* update other deps

* Update to RN 0.67.2

* fix Android build (mmkv)

* Fix crash when root message is deleted from the thread screen

* Fix gif emoji playing at high speed on iOS ProMotion capable devices
2022-02-02 15:28:57 -03:00

30 lines
1.7 KiB
Diff

diff --git a/node_modules/react-native-mmkv-storage/ios/MMKVNative.mm b/node_modules/react-native-mmkv-storage/ios/MMKVNative.mm
index 352a28f..0f63009 100644
--- a/node_modules/react-native-mmkv-storage/ios/MMKVNative.mm
+++ b/node_modules/react-native-mmkv-storage/ios/MMKVNative.mm
@@ -71,11 +71,12 @@ RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD(install)
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSLibraryDirectory,
NSUserDomainMask, YES);
- NSString *libraryPath = (NSString *)[paths firstObject];
- NSString *rootDir = [libraryPath stringByAppendingPathComponent:@"mmkv"];
- rPath = rootDir;
+ NSBundle *bundle = [NSBundle mainBundle];
+ NSString *APP_GROUP_ID = [bundle objectForInfoDictionaryKey:@"AppGroupIdentifier"];
+ NSString *groupDir = [[NSFileManager defaultManager] containerURLForSecurityApplicationGroupIdentifier:APP_GROUP_ID].path;
+ rPath = groupDir;
_secureStorage = [[SecureStorage alloc] init];
- [MMKV initializeMMKV:rootDir];
+ [MMKV initializeMMKV:nil groupDir:groupDir logLevel:MMKVLogInfo];
[self migrate];
install(*(jsi::Runtime *)jsiRuntime);
return @true;
@@ -179,7 +180,7 @@ static void install(jsi::Runtime &jsiRuntime) {
jsiRuntime, PropNameID::forAscii(jsiRuntime, "initializeMMKV"), 0,
[](Runtime &runtime, const Value &thisValue, const Value *arguments,
size_t count) -> Value {
- [MMKV initializeMMKV:rPath];
+ [MMKV initializeMMKV:nil groupDir:rPath logLevel:MMKVLogInfo];
return Value::undefined();
});