@@ -314,7 +314,7 @@ - (NSDictionary *)constantsToExport
314314#pragma mark - fs.stat
315315RCT_EXPORT_METHOD (stat:(NSString *)target callback:(RCTResponseSenderBlock) callback)
316316{
317-
317+
318318 [RNFetchBlobFS getPathFromUri: target completionHandler: ^(NSString *path, ALAssetRepresentation *asset) {
319319 __block NSMutableArray * result;
320320 if (path != nil )
@@ -323,14 +323,14 @@ - (NSDictionary *)constantsToExport
323323 BOOL exist = nil ;
324324 BOOL isDir = nil ;
325325 NSError * error = nil ;
326-
326+
327327 exist = [fm fileExistsAtPath: path isDirectory: &isDir];
328328 if (exist == NO ) {
329329 callback (@[[NSString stringWithFormat: @" failed to stat path `%@ ` for it is not exist or it is not exist" , path]]);
330330 return ;
331331 }
332332 result = [RNFetchBlobFS stat: path error: &error];
333-
333+
334334 if (error == nil )
335335 callback (@[[NSNull null ], result]);
336336 else
@@ -389,7 +389,7 @@ - (NSDictionary *)constantsToExport
389389#pragma mark - fs.cp
390390RCT_EXPORT_METHOD (cp:(NSString *)src toPath:(NSString *)dest callback:(RCTResponseSenderBlock) callback)
391391{
392-
392+
393393// path = [RNFetchBlobFS getPathOfAsset:path];
394394 [RNFetchBlobFS getPathFromUri: src completionHandler: ^(NSString *path, ALAssetRepresentation *asset) {
395395 NSError * error = nil ;
@@ -401,14 +401,14 @@ - (NSDictionary *)constantsToExport
401401 else
402402 {
403403 BOOL result = [[NSFileManager defaultManager ] copyItemAtURL: [NSURL fileURLWithPath: path] toURL: [NSURL fileURLWithPath: dest] error: &error];
404-
404+
405405 if (error == nil )
406406 callback (@[[NSNull null ], @YES ]);
407407 else
408408 callback (@[[error localizedDescription ], @NO ]);
409409 }
410410 }];
411-
411+
412412}
413413
414414
@@ -470,7 +470,7 @@ - (NSDictionary *)constantsToExport
470470 else
471471 bufferSize = 4096 ;
472472 }
473-
473+
474474 dispatch_async (fsQueue, ^{
475475 [RNFetchBlobFS readStream: path encoding: encoding bufferSize: bufferSize tick: tick streamId: streamId bridgeRef: _bridge];
476476 });
@@ -496,7 +496,7 @@ - (NSDictionary *)constantsToExport
496496#pragma mark - net.enableProgressReport
497497RCT_EXPORT_METHOD (enableProgressReport:(NSString *)taskId interval:(nonnull NSNumber *)interval count:(nonnull NSNumber *)count)
498498{
499-
499+
500500 RNFetchBlobProgress * cfg = [[RNFetchBlobProgress alloc ] initWithType: Download interval: interval count: count];
501501 [RNFetchBlobNetwork enableProgressReport: taskId config: cfg];
502502}
@@ -523,9 +523,10 @@ - (NSDictionary *)constantsToExport
523523 UIViewController *rootCtrl = [[[[UIApplication sharedApplication ] delegate ] window ] rootViewController ];
524524 documentController.delegate = self;
525525 if (scheme == nil || [[UIApplication sharedApplication ] canOpenURL: [NSURL URLWithString: scheme]]) {
526- dispatch_sync (dispatch_get_main_queue (), ^{
527- [documentController presentOptionsMenuFromRect: rootCtrl.view.bounds inView: rootCtrl.view animated: YES ];
528- });
526+ CGRect rect = CGRectMake (0.0 , 0.0 , 0.0 , 0.0 );
527+ dispatch_sync (dispatch_get_main_queue (), ^{
528+ [documentController presentOptionsMenuFromRect: rect inView: rootCtrl.view animated: YES ];
529+ });
529530 resolve (@[[NSNull null ]]);
530531 } else {
531532 reject (@" RNFetchBlob could not open document" , @" scheme is not supported" , nil );
@@ -541,7 +542,7 @@ - (NSDictionary *)constantsToExport
541542 // NSURL * url = [[NSURL alloc] initWithString:uri];
542543 documentController = [UIDocumentInteractionController interactionControllerWithURL: url];
543544 documentController.delegate = self;
544-
545+
545546 if (scheme == nil || [[UIApplication sharedApplication ] canOpenURL: [NSURL URLWithString: scheme]]) {
546547 dispatch_sync (dispatch_get_main_queue (), ^{
547548 [documentController presentPreviewAnimated: YES ];
@@ -564,7 +565,7 @@ - (NSDictionary *)constantsToExport
564565 } else {
565566 reject (@" RNFetchBlob could not open document" , [error description ], nil );
566567 }
567-
568+
568569}
569570
570571
0 commit comments