Files
mattermost-mobile/patches/react-native-mmkv-storage+0.4.4.patch
Mattermost Build 19cd3722e5 Fixes for release 1.42 (#5339) (#5340)
* Downgrade MMKV to 0.4.4

* Handle undefined in getMyTeams selector

* Set minimum server version to 5.31.3 and update unsupported URL

(cherry picked from commit 0a2a490e81)

Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
2021-04-19 11:50:57 -04:00

20 lines
1.1 KiB
Diff

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"]];