react-native-blob-util 0.17.3 → 0.18.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -16,14 +16,14 @@
16
16
  #import <React/RCTLog.h>
17
17
  #import <React/RCTRootView.h>
18
18
  #import <React/RCTBridge.h>
19
- #import <React/RCTEventDispatcher.h>
20
19
  #import <React/RCTBridgeModule.h>
20
+ #import <React/RCTEventEmitter.h>
21
21
  #else
22
22
  #import "RCTBridgeModule.h"
23
23
  #import "RCTLog.h"
24
24
  #import "RCTRootView.h"
25
25
  #import "RCTBridge.h"
26
- #import "RCTEventDispatcher.h"
26
+ #import "RCTEventEmitter.h"
27
27
  #endif
28
28
 
29
29
  #import <UIKit/UIKit.h>
@@ -33,7 +33,7 @@
33
33
  #endif
34
34
 
35
35
 
36
- @interface ReactNativeBlobUtil : NSObject <RCTBridgeModule, UIDocumentInteractionControllerDelegate> {
36
+ @interface ReactNativeBlobUtil : RCTEventEmitter <RCTBridgeModule, UIDocumentInteractionControllerDelegate> {
37
37
 
38
38
  NSString * filePathPrefix;
39
39
 
@@ -42,7 +42,8 @@
42
42
  @property (nonatomic) NSString * filePathPrefix;
43
43
  @property (retain) UIDocumentInteractionController * documentController;
44
44
 
45
- + (RCTEventDispatcher *)getRCTEventDispatcher;
45
+ -(void) emitEvent:(NSString *)name body:(NSString *) body;
46
+ -(void) emitEventDict:(NSString *)name body:(NSDictionary *) body;
46
47
 
47
48
  @end
48
49
 
@@ -15,7 +15,6 @@
15
15
  #import <ReactNativeBlobUtilSpec/ReactNativeBlobUtilSpec.h>
16
16
  #endif
17
17
 
18
- __strong RCTEventDispatcher * eventDispatcherRef;
19
18
  dispatch_queue_t commonTaskQueue;
20
19
  dispatch_queue_t fsQueue;
21
20
 
@@ -32,6 +31,44 @@ dispatch_queue_t fsQueue;
32
31
  @synthesize filePathPrefix;
33
32
  @synthesize documentController;
34
33
  @synthesize bridge;
34
+ bool hasListeners;
35
+
36
+ - (NSArray<NSString*> *)supportedEvents {
37
+ return @[@"ReactNativeBlobUtilState", @"ReactNativeBlobUtilServerPush", @"ReactNativeBlobUtilProgress", @"ReactNativeBlobUtilProgress-upload", @"ReactNativeBlobUtilExpire", @"ReactNativeBlobUtilMessage", @"ReactNativeBlobUtilFilesystem", @"log", @"warn", @"error", @"data", @"end", @"reportProgress", @"reportUploadProgress"];
38
+ }
39
+
40
+ // Will be called when this module's first listener is added.
41
+ -(void)startObserving {
42
+ hasListeners = YES;
43
+ // Set up any upstream listeners or background tasks as necessary
44
+ }
45
+
46
+ // Will be called when this module's last listener is removed, or on dealloc.
47
+ -(void)stopObserving {
48
+ hasListeners = NO;
49
+ // Remove upstream listeners, stop unnecessary background tasks
50
+ }
51
+
52
+ - (void)emitEvent:(NSString *)name body:(NSString *) body
53
+ {
54
+ if (hasListeners) {// Only send events if anyone is listening
55
+ [self sendEventWithName:name body:body];
56
+ }
57
+ }
58
+ - (void)emitEventDict:(NSString *)name body:(NSDictionary *) body
59
+ {
60
+ NSError *error;
61
+ NSData *jsonData = [NSJSONSerialization dataWithJSONObject:body
62
+ options:NSJSONWritingPrettyPrinted
63
+ error:&error];
64
+
65
+ if (error) {
66
+ NSLog(@"Got an error: %@", error);
67
+ } else {
68
+ NSString *jsonString = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
69
+ [self emitEvent:name body:jsonString];
70
+ }
71
+ }
35
72
 
36
73
  - (dispatch_queue_t) methodQueue {
37
74
  if(commonTaskQueue == nil)
@@ -39,15 +76,6 @@ dispatch_queue_t fsQueue;
39
76
  return commonTaskQueue;
40
77
  }
41
78
 
42
- + (RCTEventDispatcher *)getRCTEventDispatcher
43
- {
44
- RCTRootView * rootView = (RCTRootView*) [[UIApplication sharedApplication] keyWindow].rootViewController.view;
45
- #if RCT_NEW_ARCH_ENABLED
46
- return (RCTEventDispatcher *)[rootView.moduleRegistry moduleForName:"EventDispatcher"];
47
- #else
48
- return rootView.bridge.eventDispatcher;
49
- #endif
50
- }
51
79
 
52
80
  + (BOOL)requiresMainQueueSetup {
53
81
  return NO;
@@ -67,10 +95,6 @@ RCT_EXPORT_MODULE();
67
95
  if(![[NSFileManager defaultManager] fileExistsAtPath: [ReactNativeBlobUtilFS getTempPath] isDirectory:&isDir]) {
68
96
  [[NSFileManager defaultManager] createDirectoryAtPath:[ReactNativeBlobUtilFS getTempPath] withIntermediateDirectories:YES attributes:nil error:NULL];
69
97
  }
70
- dispatch_async(dispatch_get_main_queue(), ^{
71
- eventDispatcherRef = bridge.eventDispatcher;
72
- [ReactNativeBlobUtilNetwork emitExpiredTasks: eventDispatcherRef];
73
- });
74
98
 
75
99
  return self;
76
100
  }
@@ -96,7 +120,7 @@ RCT_EXPORT_MODULE();
96
120
  @"SDCardDir": @"",
97
121
  @"SDCardApplicationDir": @"",
98
122
  @"DCIMDir": @"",
99
- // Android only legacy constants
123
+ // Android only legacy constants
100
124
  @"LegacyDCIMDir": @"",
101
125
  @"LegacyPictureDir": @"",
102
126
  @"LegacyMusicDir": @"",
@@ -135,7 +159,7 @@ RCT_EXPORT_METHOD(fetchBlobForm:(NSDictionary *)options
135
159
  {
136
160
  [[ReactNativeBlobUtilNetwork sharedInstance] sendRequest:options
137
161
  contentLength:bodyLength
138
- eventDispatcher:eventDispatcherRef
162
+ baseModule:self
139
163
  taskId:taskId
140
164
  withRequest:req
141
165
  callback:callback];
@@ -172,7 +196,7 @@ RCT_EXPORT_METHOD(fetchBlob:(NSDictionary *)options
172
196
  {
173
197
  [[ReactNativeBlobUtilNetwork sharedInstance] sendRequest:options
174
198
  contentLength:bodyLength
175
- eventDispatcher:eventDispatcherRef
199
+ baseModule:self
176
200
  taskId:taskId
177
201
  withRequest:req
178
202
  callback:callback];
@@ -366,7 +390,7 @@ RCT_EXPORT_METHOD(writeStream:(NSString *)path
366
390
  appendData:(BOOL)append
367
391
  callback:(RCTResponseSenderBlock)callback)
368
392
  {
369
- ReactNativeBlobUtilFS * fileStream = [[ReactNativeBlobUtilFS alloc] initWithEventDispatcherRef:eventDispatcherRef];
393
+ ReactNativeBlobUtilFS * fileStream = [[ReactNativeBlobUtilFS alloc] init];
370
394
  NSFileManager * fm = [NSFileManager defaultManager];
371
395
  NSString * folder = [path stringByDeletingLastPathComponent];
372
396
  NSError* err = nil;
@@ -696,7 +720,7 @@ RCT_EXPORT_METHOD(readStream:(NSString *)path encoding:(NSString *)encoding buff
696
720
  }
697
721
 
698
722
  dispatch_async(fsQueue, ^{
699
- [ReactNativeBlobUtilFS readStream:path encoding:encoding bufferSize:bufferSize tick:tick streamId:streamId eventDispatcherRef:eventDispatcherRef];
723
+ [ReactNativeBlobUtilFS readStream:path encoding:encoding bufferSize:bufferSize tick:tick streamId:streamId baseModule:self];
700
724
  });
701
725
  }
702
726
 
@@ -877,13 +901,6 @@ RCT_EXPORT_METHOD(df:(RCTResponseSenderBlock)callback)
877
901
  return window.rootViewController;
878
902
  }
879
903
 
880
- # pragma mark - check expired network events
881
-
882
- RCT_EXPORT_METHOD(emitExpiredEvent:(RCTResponseSenderBlock)callback)
883
- {
884
- [ReactNativeBlobUtilNetwork emitExpiredTasks:eventDispatcherRef];
885
- }
886
-
887
904
  # pragma mark - Android Only methods
888
905
  // These methods are required because in the New Arch we have a single spec for both platforms
889
906
  - (void)actionViewIntent:(NSString *) path
@@ -7,15 +7,16 @@
7
7
  objects = {
8
8
 
9
9
  /* Begin PBXBuildFile section */
10
- 8C4801A6200CF71700FED7ED /* ReactNativeBlobUtilRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = 8C4801A5200CF71700FED7ED /* ReactNativeBlobUtilRequest.m */; };
11
- 9FD8D3C326F1736000009F35 /* ReactNativeBlobUtilFileTransformer.m in Sources */ = {isa = PBXBuildFile; fileRef = 9FD8D3C226F1736000009F35 /* ReactNativeBlobUtilFileTransformer.m */; };
12
- A158F4271D052E49006FFD38 /* ReactNativeBlobUtilFS.m in Sources */ = {isa = PBXBuildFile; fileRef = A158F4261D052E49006FFD38 /* ReactNativeBlobUtilFS.m */; };
13
- A158F42D1D0535BB006FFD38 /* ReactNativeBlobUtilConst.m in Sources */ = {isa = PBXBuildFile; fileRef = A158F42C1D0535BB006FFD38 /* ReactNativeBlobUtilConst.m */; };
14
- A158F4301D0539DB006FFD38 /* ReactNativeBlobUtilNetwork.m in Sources */ = {isa = PBXBuildFile; fileRef = A158F42F1D0539DB006FFD38 /* ReactNativeBlobUtilNetwork.m */; };
15
- A15C30141CD25C330074CB35 /* ReactNativeBlobUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = A15C30131CD25C330074CB35 /* ReactNativeBlobUtil.m */; };
10
+ 11A307EE2A06E45800E56674 /* ReactNativeBlobUtil.mm in Sources */ = {isa = PBXBuildFile; fileRef = 11A307ED2A06E45800E56674 /* ReactNativeBlobUtil.mm */; };
11
+ 11A307F82A06E47700E56674 /* ReactNativeBlobUtilNetwork.mm in Sources */ = {isa = PBXBuildFile; fileRef = 11A307EF2A06E47300E56674 /* ReactNativeBlobUtilNetwork.mm */; };
12
+ 11A307F92A06E47700E56674 /* ReactNativeBlobUtilReqBuilder.mm in Sources */ = {isa = PBXBuildFile; fileRef = 11A307F02A06E47400E56674 /* ReactNativeBlobUtilReqBuilder.mm */; };
13
+ 11A307FA2A06E47700E56674 /* ReactNativeBlobUtilFS.mm in Sources */ = {isa = PBXBuildFile; fileRef = 11A307F12A06E47400E56674 /* ReactNativeBlobUtilFS.mm */; };
14
+ 11A307FB2A06E47700E56674 /* ReactNativeBlobUtilFileTransformer.mm in Sources */ = {isa = PBXBuildFile; fileRef = 11A307F32A06E47400E56674 /* ReactNativeBlobUtilFileTransformer.mm */; };
15
+ 11A307FC2A06E47700E56674 /* ReactNativeBlobUtilConst.mm in Sources */ = {isa = PBXBuildFile; fileRef = 11A307F42A06E47500E56674 /* ReactNativeBlobUtilConst.mm */; };
16
+ 11A307FD2A06E47700E56674 /* ReactNativeBlobUtilProgress.mm in Sources */ = {isa = PBXBuildFile; fileRef = 11A307F52A06E47500E56674 /* ReactNativeBlobUtilProgress.mm */; };
17
+ 11A307FE2A06E47700E56674 /* ReactNativeBlobUtilRequest.mm in Sources */ = {isa = PBXBuildFile; fileRef = 11A307F62A06E47500E56674 /* ReactNativeBlobUtilRequest.mm */; };
18
+ 11A308002A06E92D00E56674 /* React.podspec in Frameworks */ = {isa = PBXBuildFile; fileRef = 11A307FF2A06E92D00E56674 /* React.podspec */; };
16
19
  A166D1AA1CE0647A00273590 /* ReactNativeBlobUtil.h in Sources */ = {isa = PBXBuildFile; fileRef = A15C30111CD25C330074CB35 /* ReactNativeBlobUtil.h */; };
17
- A19B48251D98102400E6868A /* ReactNativeBlobUtilProgress.m in Sources */ = {isa = PBXBuildFile; fileRef = A19B48241D98102400E6868A /* ReactNativeBlobUtilProgress.m */; };
18
- A1AAE2991D300E4D0051D11C /* ReactNativeBlobUtilReqBuilder.m in Sources */ = {isa = PBXBuildFile; fileRef = A1AAE2981D300E4D0051D11C /* ReactNativeBlobUtilReqBuilder.m */; };
19
20
  /* End PBXBuildFile section */
20
21
 
21
22
  /* Begin PBXCopyFilesBuildPhase section */
@@ -31,23 +32,28 @@
31
32
  /* End PBXCopyFilesBuildPhase section */
32
33
 
33
34
  /* Begin PBXFileReference section */
35
+ 11A307ED2A06E45800E56674 /* ReactNativeBlobUtil.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = ReactNativeBlobUtil.mm; path = ReactNativeBlobUtil/ReactNativeBlobUtil.mm; sourceTree = "<group>"; };
36
+ 11A307EF2A06E47300E56674 /* ReactNativeBlobUtilNetwork.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ReactNativeBlobUtilNetwork.mm; sourceTree = "<group>"; };
37
+ 11A307F02A06E47400E56674 /* ReactNativeBlobUtilReqBuilder.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ReactNativeBlobUtilReqBuilder.mm; sourceTree = "<group>"; };
38
+ 11A307F12A06E47400E56674 /* ReactNativeBlobUtilFS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ReactNativeBlobUtilFS.mm; sourceTree = "<group>"; };
39
+ 11A307F22A06E47400E56674 /* ReactNativeBlobUtil */ = {isa = PBXFileReference; lastKnownFileType = folder; path = ReactNativeBlobUtil; sourceTree = "<group>"; };
40
+ 11A307F32A06E47400E56674 /* ReactNativeBlobUtilFileTransformer.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ReactNativeBlobUtilFileTransformer.mm; sourceTree = "<group>"; };
41
+ 11A307F42A06E47500E56674 /* ReactNativeBlobUtilConst.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ReactNativeBlobUtilConst.mm; sourceTree = "<group>"; };
42
+ 11A307F52A06E47500E56674 /* ReactNativeBlobUtilProgress.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ReactNativeBlobUtilProgress.mm; sourceTree = "<group>"; };
43
+ 11A307F62A06E47500E56674 /* ReactNativeBlobUtilRequest.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ReactNativeBlobUtilRequest.mm; sourceTree = "<group>"; };
44
+ 11A307FF2A06E92D00E56674 /* React.podspec */ = {isa = PBXFileReference; lastKnownFileType = text; name = React.podspec; path = "../node_modules/react-native/React.podspec"; sourceTree = "<group>"; };
45
+ 1BDA30C5220621C99F823CB9 /* Pods-ReactNativeBlobUtil.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ReactNativeBlobUtil.release.xcconfig"; path = "Target Support Files/Pods-ReactNativeBlobUtil/Pods-ReactNativeBlobUtil.release.xcconfig"; sourceTree = "<group>"; };
46
+ 636B49C8101263AC402FD024 /* Pods_ReactNativeBlobUtil.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_ReactNativeBlobUtil.framework; sourceTree = BUILT_PRODUCTS_DIR; };
34
47
  8C4801A4200CF71700FED7ED /* ReactNativeBlobUtilRequest.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ReactNativeBlobUtilRequest.h; sourceTree = "<group>"; };
35
- 8C4801A5200CF71700FED7ED /* ReactNativeBlobUtilRequest.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ReactNativeBlobUtilRequest.m; sourceTree = "<group>"; };
36
48
  9FD8D3C126F1709A00009F35 /* ReactNativeBlobUtilFileTransformer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ReactNativeBlobUtilFileTransformer.h; sourceTree = "<group>"; };
37
- 9FD8D3C226F1736000009F35 /* ReactNativeBlobUtilFileTransformer.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ReactNativeBlobUtilFileTransformer.m; sourceTree = "<group>"; };
38
- A158F4261D052E49006FFD38 /* ReactNativeBlobUtilFS.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ReactNativeBlobUtilFS.m; sourceTree = "<group>"; };
39
49
  A158F4281D052E57006FFD38 /* ReactNativeBlobUtilFS.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ReactNativeBlobUtilFS.h; sourceTree = "<group>"; };
40
50
  A158F4291D0534A9006FFD38 /* ReactNativeBlobUtilConst.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ReactNativeBlobUtilConst.h; sourceTree = "<group>"; };
41
- A158F42C1D0535BB006FFD38 /* ReactNativeBlobUtilConst.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ReactNativeBlobUtilConst.m; sourceTree = "<group>"; };
42
51
  A158F42E1D0539CE006FFD38 /* ReactNativeBlobUtilNetwork.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ReactNativeBlobUtilNetwork.h; sourceTree = "<group>"; };
43
- A158F42F1D0539DB006FFD38 /* ReactNativeBlobUtilNetwork.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ReactNativeBlobUtilNetwork.m; sourceTree = "<group>"; };
44
52
  A15C300E1CD25C330074CB35 /* libReactNativeBlobUtil.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libReactNativeBlobUtil.a; sourceTree = BUILT_PRODUCTS_DIR; };
45
53
  A15C30111CD25C330074CB35 /* ReactNativeBlobUtil.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = ReactNativeBlobUtil.h; path = ReactNativeBlobUtil/ReactNativeBlobUtil.h; sourceTree = "<group>"; };
46
- A15C30131CD25C330074CB35 /* ReactNativeBlobUtil.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = ReactNativeBlobUtil.m; path = ReactNativeBlobUtil/ReactNativeBlobUtil.m; sourceTree = "<group>"; };
47
54
  A19B48231D98100800E6868A /* ReactNativeBlobUtilProgress.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ReactNativeBlobUtilProgress.h; sourceTree = "<group>"; };
48
- A19B48241D98102400E6868A /* ReactNativeBlobUtilProgress.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ReactNativeBlobUtilProgress.m; sourceTree = "<group>"; };
49
55
  A1AAE2971D300E3E0051D11C /* ReactNativeBlobUtilReqBuilder.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ReactNativeBlobUtilReqBuilder.h; sourceTree = "<group>"; };
50
- A1AAE2981D300E4D0051D11C /* ReactNativeBlobUtilReqBuilder.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ReactNativeBlobUtilReqBuilder.m; sourceTree = "<group>"; };
56
+ E83F89B1EFF498D9833537A4 /* Pods-ReactNativeBlobUtil.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ReactNativeBlobUtil.debug.xcconfig"; path = "Target Support Files/Pods-ReactNativeBlobUtil/Pods-ReactNativeBlobUtil.debug.xcconfig"; sourceTree = "<group>"; };
51
57
  /* End PBXFileReference section */
52
58
 
53
59
  /* Begin PBXFrameworksBuildPhase section */
@@ -55,12 +61,22 @@
55
61
  isa = PBXFrameworksBuildPhase;
56
62
  buildActionMask = 2147483647;
57
63
  files = (
64
+ 11A308002A06E92D00E56674 /* React.podspec in Frameworks */,
58
65
  );
59
66
  runOnlyForDeploymentPostprocessing = 0;
60
67
  };
61
68
  /* End PBXFrameworksBuildPhase section */
62
69
 
63
70
  /* Begin PBXGroup section */
71
+ 193768812AF9A9C46358234E /* Frameworks */ = {
72
+ isa = PBXGroup;
73
+ children = (
74
+ 11A307FF2A06E92D00E56674 /* React.podspec */,
75
+ 636B49C8101263AC402FD024 /* Pods_ReactNativeBlobUtil.framework */,
76
+ );
77
+ name = Frameworks;
78
+ sourceTree = "<group>";
79
+ };
64
80
  8BD9ABDFAF76406291A798F2 /* Libraries */ = {
65
81
  isa = PBXGroup;
66
82
  children = (
@@ -71,24 +87,27 @@
71
87
  A15C30051CD25C330074CB35 = {
72
88
  isa = PBXGroup;
73
89
  children = (
74
- 9FD8D3C226F1736000009F35 /* ReactNativeBlobUtilFileTransformer.m */,
90
+ 11A307F22A06E47400E56674 /* ReactNativeBlobUtil */,
91
+ 11A307F42A06E47500E56674 /* ReactNativeBlobUtilConst.mm */,
92
+ 11A307F32A06E47400E56674 /* ReactNativeBlobUtilFileTransformer.mm */,
93
+ 11A307F12A06E47400E56674 /* ReactNativeBlobUtilFS.mm */,
94
+ 11A307EF2A06E47300E56674 /* ReactNativeBlobUtilNetwork.mm */,
95
+ 11A307F52A06E47500E56674 /* ReactNativeBlobUtilProgress.mm */,
96
+ 11A307F02A06E47400E56674 /* ReactNativeBlobUtilReqBuilder.mm */,
97
+ 11A307F62A06E47500E56674 /* ReactNativeBlobUtilRequest.mm */,
98
+ 11A307ED2A06E45800E56674 /* ReactNativeBlobUtil.mm */,
75
99
  9FD8D3C126F1709A00009F35 /* ReactNativeBlobUtilFileTransformer.h */,
76
- A19B48241D98102400E6868A /* ReactNativeBlobUtilProgress.m */,
77
100
  A19B48231D98100800E6868A /* ReactNativeBlobUtilProgress.h */,
78
- A1AAE2981D300E4D0051D11C /* ReactNativeBlobUtilReqBuilder.m */,
79
101
  A1AAE2971D300E3E0051D11C /* ReactNativeBlobUtilReqBuilder.h */,
80
102
  A158F42E1D0539CE006FFD38 /* ReactNativeBlobUtilNetwork.h */,
81
- A158F42F1D0539DB006FFD38 /* ReactNativeBlobUtilNetwork.m */,
82
103
  8C4801A4200CF71700FED7ED /* ReactNativeBlobUtilRequest.h */,
83
- 8C4801A5200CF71700FED7ED /* ReactNativeBlobUtilRequest.m */,
84
- A158F42C1D0535BB006FFD38 /* ReactNativeBlobUtilConst.m */,
85
104
  A158F4291D0534A9006FFD38 /* ReactNativeBlobUtilConst.h */,
86
105
  A158F4281D052E57006FFD38 /* ReactNativeBlobUtilFS.h */,
87
- A158F4261D052E49006FFD38 /* ReactNativeBlobUtilFS.m */,
88
106
  A15C30111CD25C330074CB35 /* ReactNativeBlobUtil.h */,
89
- A15C30131CD25C330074CB35 /* ReactNativeBlobUtil.m */,
90
107
  A15C300F1CD25C330074CB35 /* Products */,
91
108
  8BD9ABDFAF76406291A798F2 /* Libraries */,
109
+ BE4E5761992F01F75082D147 /* Pods */,
110
+ 193768812AF9A9C46358234E /* Frameworks */,
92
111
  );
93
112
  sourceTree = "<group>";
94
113
  };
@@ -100,6 +119,15 @@
100
119
  name = Products;
101
120
  sourceTree = "<group>";
102
121
  };
122
+ BE4E5761992F01F75082D147 /* Pods */ = {
123
+ isa = PBXGroup;
124
+ children = (
125
+ E83F89B1EFF498D9833537A4 /* Pods-ReactNativeBlobUtil.debug.xcconfig */,
126
+ 1BDA30C5220621C99F823CB9 /* Pods-ReactNativeBlobUtil.release.xcconfig */,
127
+ );
128
+ path = Pods;
129
+ sourceTree = "<group>";
130
+ };
103
131
  /* End PBXGroup section */
104
132
 
105
133
  /* Begin PBXNativeTarget section */
@@ -107,6 +135,7 @@
107
135
  isa = PBXNativeTarget;
108
136
  buildConfigurationList = A15C30171CD25C330074CB35 /* Build configuration list for PBXNativeTarget "ReactNativeBlobUtil" */;
109
137
  buildPhases = (
138
+ D6BB6591D040E628F7A16E89 /* [CP] Check Pods Manifest.lock */,
110
139
  A15C300A1CD25C330074CB35 /* Sources */,
111
140
  A15C300B1CD25C330074CB35 /* Frameworks */,
112
141
  A15C300C1CD25C330074CB35 /* CopyFiles */,
@@ -126,7 +155,7 @@
126
155
  A15C30061CD25C330074CB35 /* Project object */ = {
127
156
  isa = PBXProject;
128
157
  attributes = {
129
- LastUpgradeCheck = 730;
158
+ LastUpgradeCheck = 1420;
130
159
  ORGANIZATIONNAME = wkh237.github.io;
131
160
  TargetAttributes = {
132
161
  A15C300D1CD25C330074CB35 = {
@@ -136,10 +165,11 @@
136
165
  };
137
166
  buildConfigurationList = A15C30091CD25C330074CB35 /* Build configuration list for PBXProject "ReactNativeBlobUtil" */;
138
167
  compatibilityVersion = "Xcode 3.2";
139
- developmentRegion = English;
168
+ developmentRegion = en;
140
169
  hasScannedForEncodings = 0;
141
170
  knownRegions = (
142
171
  en,
172
+ Base,
143
173
  );
144
174
  mainGroup = A15C30051CD25C330074CB35;
145
175
  productRefGroup = A15C300F1CD25C330074CB35 /* Products */;
@@ -151,20 +181,45 @@
151
181
  };
152
182
  /* End PBXProject section */
153
183
 
184
+ /* Begin PBXShellScriptBuildPhase section */
185
+ D6BB6591D040E628F7A16E89 /* [CP] Check Pods Manifest.lock */ = {
186
+ isa = PBXShellScriptBuildPhase;
187
+ buildActionMask = 2147483647;
188
+ files = (
189
+ );
190
+ inputFileListPaths = (
191
+ );
192
+ inputPaths = (
193
+ "${PODS_PODFILE_DIR_PATH}/Podfile.lock",
194
+ "${PODS_ROOT}/Manifest.lock",
195
+ );
196
+ name = "[CP] Check Pods Manifest.lock";
197
+ outputFileListPaths = (
198
+ );
199
+ outputPaths = (
200
+ "$(DERIVED_FILE_DIR)/Pods-ReactNativeBlobUtil-checkManifestLockResult.txt",
201
+ );
202
+ runOnlyForDeploymentPostprocessing = 0;
203
+ shellPath = /bin/sh;
204
+ shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
205
+ showEnvVarsInLog = 0;
206
+ };
207
+ /* End PBXShellScriptBuildPhase section */
208
+
154
209
  /* Begin PBXSourcesBuildPhase section */
155
210
  A15C300A1CD25C330074CB35 /* Sources */ = {
156
211
  isa = PBXSourcesBuildPhase;
157
212
  buildActionMask = 2147483647;
158
213
  files = (
214
+ 11A307F92A06E47700E56674 /* ReactNativeBlobUtilReqBuilder.mm in Sources */,
159
215
  A166D1AA1CE0647A00273590 /* ReactNativeBlobUtil.h in Sources */,
160
- 8C4801A6200CF71700FED7ED /* ReactNativeBlobUtilRequest.m in Sources */,
161
- A158F42D1D0535BB006FFD38 /* ReactNativeBlobUtilConst.m in Sources */,
162
- 9FD8D3C326F1736000009F35 /* ReactNativeBlobUtilFileTransformer.m in Sources */,
163
- A158F4271D052E49006FFD38 /* ReactNativeBlobUtilFS.m in Sources */,
164
- A158F4301D0539DB006FFD38 /* ReactNativeBlobUtilNetwork.m in Sources */,
165
- A19B48251D98102400E6868A /* ReactNativeBlobUtilProgress.m in Sources */,
166
- A1AAE2991D300E4D0051D11C /* ReactNativeBlobUtilReqBuilder.m in Sources */,
167
- A15C30141CD25C330074CB35 /* ReactNativeBlobUtil.m in Sources */,
216
+ 11A307F82A06E47700E56674 /* ReactNativeBlobUtilNetwork.mm in Sources */,
217
+ 11A307FB2A06E47700E56674 /* ReactNativeBlobUtilFileTransformer.mm in Sources */,
218
+ 11A307FE2A06E47700E56674 /* ReactNativeBlobUtilRequest.mm in Sources */,
219
+ 11A307FC2A06E47700E56674 /* ReactNativeBlobUtilConst.mm in Sources */,
220
+ 11A307EE2A06E45800E56674 /* ReactNativeBlobUtil.mm in Sources */,
221
+ 11A307FD2A06E47700E56674 /* ReactNativeBlobUtilProgress.mm in Sources */,
222
+ 11A307FA2A06E47700E56674 /* ReactNativeBlobUtilFS.mm in Sources */,
168
223
  );
169
224
  runOnlyForDeploymentPostprocessing = 0;
170
225
  };
@@ -175,18 +230,30 @@
175
230
  isa = XCBuildConfiguration;
176
231
  buildSettings = {
177
232
  ALWAYS_SEARCH_USER_PATHS = NO;
233
+ CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
178
234
  CLANG_ANALYZER_NONNULL = YES;
179
235
  CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
180
236
  CLANG_CXX_LIBRARY = "libc++";
181
237
  CLANG_ENABLE_MODULES = YES;
182
238
  CLANG_ENABLE_OBJC_ARC = YES;
239
+ CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
183
240
  CLANG_WARN_BOOL_CONVERSION = YES;
241
+ CLANG_WARN_COMMA = YES;
184
242
  CLANG_WARN_CONSTANT_CONVERSION = YES;
243
+ CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
185
244
  CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
186
245
  CLANG_WARN_EMPTY_BODY = YES;
187
246
  CLANG_WARN_ENUM_CONVERSION = YES;
247
+ CLANG_WARN_INFINITE_RECURSION = YES;
188
248
  CLANG_WARN_INT_CONVERSION = YES;
249
+ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
250
+ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
251
+ CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
189
252
  CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
253
+ CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
254
+ CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
255
+ CLANG_WARN_STRICT_PROTOTYPES = YES;
256
+ CLANG_WARN_SUSPICIOUS_MOVE = YES;
190
257
  CLANG_WARN_UNREACHABLE_CODE = YES;
191
258
  CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
192
259
  "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
@@ -208,7 +275,7 @@
208
275
  GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
209
276
  GCC_WARN_UNUSED_FUNCTION = YES;
210
277
  GCC_WARN_UNUSED_VARIABLE = YES;
211
- IPHONEOS_DEPLOYMENT_TARGET = 8.0;
278
+ IPHONEOS_DEPLOYMENT_TARGET = 12.0;
212
279
  MTL_ENABLE_DEBUG_INFO = YES;
213
280
  ONLY_ACTIVE_ARCH = YES;
214
281
  SDKROOT = iphoneos;
@@ -219,18 +286,30 @@
219
286
  isa = XCBuildConfiguration;
220
287
  buildSettings = {
221
288
  ALWAYS_SEARCH_USER_PATHS = NO;
289
+ CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
222
290
  CLANG_ANALYZER_NONNULL = YES;
223
291
  CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
224
292
  CLANG_CXX_LIBRARY = "libc++";
225
293
  CLANG_ENABLE_MODULES = YES;
226
294
  CLANG_ENABLE_OBJC_ARC = YES;
295
+ CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
227
296
  CLANG_WARN_BOOL_CONVERSION = YES;
297
+ CLANG_WARN_COMMA = YES;
228
298
  CLANG_WARN_CONSTANT_CONVERSION = YES;
299
+ CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
229
300
  CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
230
301
  CLANG_WARN_EMPTY_BODY = YES;
231
302
  CLANG_WARN_ENUM_CONVERSION = YES;
303
+ CLANG_WARN_INFINITE_RECURSION = YES;
232
304
  CLANG_WARN_INT_CONVERSION = YES;
305
+ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
306
+ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
307
+ CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
233
308
  CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
309
+ CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
310
+ CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
311
+ CLANG_WARN_STRICT_PROTOTYPES = YES;
312
+ CLANG_WARN_SUSPICIOUS_MOVE = YES;
234
313
  CLANG_WARN_UNREACHABLE_CODE = YES;
235
314
  CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
236
315
  "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
@@ -246,7 +325,7 @@
246
325
  GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
247
326
  GCC_WARN_UNUSED_FUNCTION = YES;
248
327
  GCC_WARN_UNUSED_VARIABLE = YES;
249
- IPHONEOS_DEPLOYMENT_TARGET = 8.0;
328
+ IPHONEOS_DEPLOYMENT_TARGET = 12.0;
250
329
  MTL_ENABLE_DEBUG_INFO = NO;
251
330
  SDKROOT = iphoneos;
252
331
  VALIDATE_PRODUCT = YES;
@@ -255,6 +334,7 @@
255
334
  };
256
335
  A15C30181CD25C330074CB35 /* Debug */ = {
257
336
  isa = XCBuildConfiguration;
337
+ baseConfigurationReference = E83F89B1EFF498D9833537A4 /* Pods-ReactNativeBlobUtil.debug.xcconfig */;
258
338
  buildSettings = {
259
339
  ALWAYS_SEARCH_USER_PATHS = NO;
260
340
  GCC_INPUT_FILETYPE = automatic;
@@ -276,6 +356,7 @@
276
356
  };
277
357
  A15C30191CD25C330074CB35 /* Release */ = {
278
358
  isa = XCBuildConfiguration;
359
+ baseConfigurationReference = 1BDA30C5220621C99F823CB9 /* Pods-ReactNativeBlobUtil.release.xcconfig */;
279
360
  buildSettings = {
280
361
  ALWAYS_SEARCH_USER_PATHS = NO;
281
362
  GCC_INPUT_FILETYPE = automatic;
@@ -22,6 +22,7 @@ extern NSString *const EVENT_PROGRESS;
22
22
  extern NSString *const EVENT_SERVER_PUSH;
23
23
  extern NSString *const EVENT_PROGRESS_UPLOAD;
24
24
  extern NSString *const EVENT_STATE_CHANGE;
25
+ extern NSString *const EVENT_FILESYSTEM;
25
26
 
26
27
  extern NSString *const FILE_PREFIX;
27
28
  extern NSString *const ASSET_PREFIX;
@@ -27,6 +27,7 @@ NSString *const EVENT_SERVER_PUSH = @"ReactNativeBlobUtilServerPush";
27
27
  NSString *const EVENT_PROGRESS = @"ReactNativeBlobUtilProgress";
28
28
  NSString *const EVENT_PROGRESS_UPLOAD = @"ReactNativeBlobUtilProgress-upload";
29
29
  NSString *const EVENT_EXPIRE = @"ReactNativeBlobUtilExpire";
30
+ NSString *const EVENT_FILESYSTEM = @"ReactNativeBlobUtilFilesystem";
30
31
 
31
32
  NSString *const MSG_EVENT = @"ReactNativeBlobUtilMessage";
32
33
  NSString *const MSG_EVENT_LOG = @"log";
@@ -24,7 +24,6 @@
24
24
  NSOutputStream * outStream;
25
25
  NSInputStream * inStream;
26
26
  RCTResponseSenderBlock callback;
27
- RCTEventDispatcher * eventDispatcher;
28
27
  Boolean isOpen;
29
28
  NSString * encoding;
30
29
  int bufferSize;
@@ -37,7 +36,6 @@
37
36
  @property (nonatomic) NSOutputStream * _Nullable outStream;
38
37
  @property (nonatomic) NSInputStream * _Nullable inStream;
39
38
  @property (strong, nonatomic) RCTResponseSenderBlock callback;
40
- @property (nonatomic) RCTEventDispatcher * eventDispatcher;
41
39
  @property (nonatomic) NSString * encoding;
42
40
  @property (nonatomic) NSString * taskId;
43
41
  @property (nonatomic) NSString * path;
@@ -85,13 +83,12 @@
85
83
  rejecter:(RCTPromiseRejectBlock)reject;
86
84
  //+ (void) writeFileFromFile:(NSString *)src toFile:(NSString *)dest append:(BOOL)append;
87
85
  + (void) writeAssetToPath:(ALAssetRepresentation * )rep dest:(NSString *)dest;
88
- + (void) readStream:(NSString *)uri encoding:(NSString * )encoding bufferSize:(int)bufferSize tick:(int)tick streamId:(NSString *)streamId eventDispatcherRef:(RCTEventDispatcher *)eventDispatcherRef;
86
+ + (void) readStream:(NSString *)uri encoding:(NSString * )encoding bufferSize:(int)bufferSize tick:(int)tick streamId:(NSString *)streamId baseModule:(ReactNativeBlobUtil *)baseModule;
89
87
  + (void) df:(RCTResponseSenderBlock)callback;
90
88
 
91
89
  // constructor
92
90
  - (id) init;
93
91
  - (id)initWithCallback:(RCTResponseSenderBlock)callback;
94
- - (id)initWithEventDispatcherRef:(RCTEventDispatcher *)eventDispatcherRef;
95
92
 
96
93
  // file stream
97
94
  - (void) openWithDestination;