Browse Source

#223 RN 0.40 compatible IOS changes

Ben Hsieh 8 years ago
parent
commit
279add449d

+ 7
- 0
src/ios/RNFetchBlob/RNFetchBlob.h View File

@@ -4,9 +4,16 @@
4 4
 //  Created by wkh237 on 2016/4/28.
5 5
 //
6 6
 
7
+#define OLD_IMPORT
8
+
7 9
 #ifndef RNFetchBlob_h
8 10
 #define RNFetchBlob_h
11
+
12
+#ifdef OLD_IMPORT
9 13
 #import "RCTBridgeModule.h"
14
+#else
15
+#import "<React/RCTBridgeModule.h>"
16
+#endif
10 17
 #import <UIKit/UIKit.h>
11 18
 
12 19
 

+ 17
- 4
src/ios/RNFetchBlob/RNFetchBlob.m View File

@@ -5,10 +5,6 @@
5 5
 //
6 6
 
7 7
 #import "RNFetchBlob.h"
8
-#import "RCTLog.h"
9
-#import "RCTRootView.h"
10
-#import "RCTBridge.h"
11
-#import "RCTEventDispatcher.h"
12 8
 #import "RNFetchBlobFS.h"
13 9
 #import "RNFetchBlobNetwork.h"
14 10
 #import "RNFetchBlobConst.h"
@@ -16,6 +12,23 @@
16 12
 #import "RNFetchBlobProgress.h"
17 13
 
18 14
 
15
+#ifdef OLD_IMPORT
16
+
17
+#import "RCTLog.h"
18
+#import "RCTRootView.h"
19
+#import "RCTBridge.h"
20
+#import "RCTEventDispatcher.h"
21
+
22
+#else
23
+
24
+#import "<React/RCTLog.h>"
25
+#import "<React/RCTRootView.h>"
26
+#import "<React/RCTBridge.h>"
27
+#import "<React/RCTEventDispatcher.h>"
28
+
29
+#endif
30
+
31
+
19 32
 __strong RCTBridge * bridgeRef;
20 33
 dispatch_queue_t commonTaskQueue;
21 34
 dispatch_queue_t fsQueue;

+ 2
- 0
src/ios/RNFetchBlobConst.h View File

@@ -6,6 +6,8 @@
6 6
 //  Copyright © 2016年 suzuri04x2. All rights reserved.
7 7
 //
8 8
 
9
+#define OLD_IMPORT
10
+
9 11
 #ifndef RNFetchBlobConst_h
10 12
 #define RNFetchBlobConst_h
11 13
 

+ 7
- 0
src/ios/RNFetchBlobFS.h View File

@@ -9,8 +9,15 @@
9 9
 #ifndef RNFetchBlobFS_h
10 10
 #define RNFetchBlobFS_h
11 11
 
12
+#import "RNFetchBlob.h"
13
+
12 14
 #import <Foundation/Foundation.h>
15
+#ifdef OLD_IMPORT
13 16
 #import "RCTBridgeModule.h"
17
+#else
18
+#import "<React/RCTBridgeModule.h>"
19
+#endif
20
+
14 21
 @import AssetsLibrary;
15 22
 
16 23
 @interface RNFetchBlobFS : NSObject <NSStreamDelegate>  {

+ 8
- 3
src/ios/RNFetchBlobFS.m View File

@@ -6,16 +6,21 @@
6 6
 //  Copyright © 2016年 suzuri04x2. All rights reserved.
7 7
 //
8 8
 
9
-
10 9
 #import <Foundation/Foundation.h>
11
-#import "RCTBridge.h"
12 10
 #import "RNFetchBlob.h"
13
-#import "RCTEventDispatcher.h"
14 11
 #import "RNFetchBlobFS.h"
15 12
 #import "RNFetchBlobConst.h"
16 13
 #import "IOS7Polyfill.h"
17 14
 @import AssetsLibrary;
18 15
 
16
+#ifdef OLD_IMPORT
17
+#import "RCTBridge.h"
18
+#import "RCTEventDispatcher.h"
19
+#else
20
+#import "<React/RCTBridge.h>"
21
+#import "<React/RCTEventDispatcher.h>"
22
+#endif
23
+
19 24
 
20 25
 NSMutableDictionary *fileStreams = nil;
21 26
 

+ 11
- 4
src/ios/RNFetchBlobNetwork.h View File

@@ -6,14 +6,21 @@
6 6
 //  Copyright © 2016 wkh237. All rights reserved.
7 7
 //
8 8
 
9
-#ifndef RNFetchBlobNetwork_h
10
-#define RNFetchBlobNetwork_h
11
-
12 9
 #import <Foundation/Foundation.h>
13
-#import "RCTBridgeModule.h"
14 10
 #import "RNFetchBlobProgress.h"
15 11
 #import "RNFetchBlobFS.h"
16 12
 
13
+#ifdef OLD_IMPORT
14
+#import "RCTBridgeModule.h"
15
+#else
16
+#import "<React/RCTBridgeModule.h>"
17
+#endif
18
+
19
+#ifndef RNFetchBlobNetwork_h
20
+#define RNFetchBlobNetwork_h
21
+
22
+
23
+
17 24
 typedef void(^CompletionHander)(NSURL * _Nullable location, NSURLResponse * _Nullable response, NSError * _Nullable error);
18 25
 typedef void(^DataTaskCompletionHander) (NSData * _Nullable resp, NSURLResponse * _Nullable response, NSError * _Nullable error);
19 26
 

+ 13
- 4
src/ios/RNFetchBlobNetwork.m View File

@@ -6,13 +6,10 @@
6 6
 //  Copyright © 2016 wkh237. All rights reserved.
7 7
 //
8 8
 
9
-#import "RCTLog.h"
9
+
10 10
 #import <Foundation/Foundation.h>
11
-#import "RCTBridge.h"
12 11
 #import "RNFetchBlob.h"
13
-#import "RCTEventDispatcher.h"
14 12
 #import "RNFetchBlobFS.h"
15
-#import "RCTRootView.h"
16 13
 #import "RNFetchBlobNetwork.h"
17 14
 #import "RNFetchBlobConst.h"
18 15
 #import "RNFetchBlobReqBuilder.h"
@@ -20,6 +17,18 @@
20 17
 #import <CommonCrypto/CommonDigest.h>
21 18
 #import "RNFetchBlobProgress.h"
22 19
 
20
+#ifdef OLD_IMPORT
21
+#import "RCTRootView.h"
22
+#import "RCTLog.h"
23
+#import "RCTEventDispatcher.h"
24
+#import "RCTBridge.h"
25
+#else
26
+#import "<React/RCTRootView.h>"
27
+#import "<React/RCTLog.h>"
28
+#import "<React/RCTEventDispatcher.h>"
29
+#import "<React/RCTBridge.h>"
30
+#endif
31
+
23 32
 ////////////////////////////////////////
24 33
 //
25 34
 //  HTTP request handler

+ 6
- 1
src/ios/RNFetchBlobReqBuilder.m View File

@@ -11,9 +11,14 @@
11 11
 #import "RNFetchBlobNetwork.h"
12 12
 #import "RNFetchBlobConst.h"
13 13
 #import "RNFetchBlobFS.h"
14
-#import "RCTLog.h"
15 14
 #import "IOS7Polyfill.h"
16 15
 
16
+#ifdef OLD_IMPORT
17
+#import "RCTLog.h"
18
+#else
19
+#import "<React/RCTLog.h>"
20
+#endif
21
+
17 22
 @interface RNFetchBlobReqBuilder()
18 23
 {
19 24