diff --git a/FS.common.js b/FS.common.js index 62b7ba73..3499d6ba 100755 --- a/FS.common.js +++ b/FS.common.js @@ -213,6 +213,10 @@ var RNFS = { return RNFSManager.pathForGroup(groupName); }, + pathForGroupSync(groupName: string): string { + return RNFSManager.pathForGroupSync(groupName); + }, + getFSInfo(): Promise { return RNFSManager.getFSInfo(); }, diff --git a/RNFSManager.m b/RNFSManager.m index 5ddd9417..8a4769a0 100755 --- a/RNFSManager.m +++ b/RNFSManager.m @@ -722,6 +722,11 @@ + (BOOL)requiresMainQueueSetup } } +RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD(pathForGroupSync:(nonnull NSString *)groupId) { + NSURL *groupURL = [[NSFileManager defaultManager] containerURLForSecurityApplicationGroupIdentifier: groupId]; + return [groupURL path]; +} + RCT_EXPORT_METHOD(getFSInfo:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject) { unsigned long long totalSpace = 0; diff --git a/index.d.ts b/index.d.ts index da3fa7de..e793a58d 100644 --- a/index.d.ts +++ b/index.d.ts @@ -123,6 +123,7 @@ export function copyFile( ): Promise export function pathForBundle(bundleNamed: string): Promise export function pathForGroup(groupName: string): Promise +export function pathForGroupSync(groupName: string): string export function getFSInfo(): Promise export function getAllExternalFilesDirs(): Promise export function unlink(filepath: string): Promise