Browse Source

#223 RN 0.40 compatible IOS changes

Ben Hsieh 8 years ago
parent
commit
cce3ec8470

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

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

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

5
 //
5
 //
6
 
6
 
7
 #import "RNFetchBlob.h"
7
 #import "RNFetchBlob.h"
8
-#import "RCTLog.h"
9
-#import "RCTRootView.h"
10
-#import "RCTBridge.h"
11
-#import "RCTEventDispatcher.h"
12
 #import "RNFetchBlobFS.h"
8
 #import "RNFetchBlobFS.h"
13
 #import "RNFetchBlobNetwork.h"
9
 #import "RNFetchBlobNetwork.h"
14
 #import "RNFetchBlobConst.h"
10
 #import "RNFetchBlobConst.h"
16
 #import "RNFetchBlobProgress.h"
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
 __strong RCTBridge * bridgeRef;
32
 __strong RCTBridge * bridgeRef;
20
 dispatch_queue_t commonTaskQueue;
33
 dispatch_queue_t commonTaskQueue;
21
 dispatch_queue_t fsQueue;
34
 dispatch_queue_t fsQueue;

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

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

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

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

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

6
 //  Copyright © 2016年 suzuri04x2. All rights reserved.
6
 //  Copyright © 2016年 suzuri04x2. All rights reserved.
7
 //
7
 //
8
 
8
 
9
-
10
 #import <Foundation/Foundation.h>
9
 #import <Foundation/Foundation.h>
11
-#import "RCTBridge.h"
12
 #import "RNFetchBlob.h"
10
 #import "RNFetchBlob.h"
13
-#import "RCTEventDispatcher.h"
14
 #import "RNFetchBlobFS.h"
11
 #import "RNFetchBlobFS.h"
15
 #import "RNFetchBlobConst.h"
12
 #import "RNFetchBlobConst.h"
16
 #import "IOS7Polyfill.h"
13
 #import "IOS7Polyfill.h"
17
 @import AssetsLibrary;
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
 NSMutableDictionary *fileStreams = nil;
25
 NSMutableDictionary *fileStreams = nil;
21
 
26
 

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

6
 //  Copyright © 2016 wkh237. All rights reserved.
6
 //  Copyright © 2016 wkh237. All rights reserved.
7
 //
7
 //
8
 
8
 
9
-#ifndef RNFetchBlobNetwork_h
10
-#define RNFetchBlobNetwork_h
11
-
12
 #import <Foundation/Foundation.h>
9
 #import <Foundation/Foundation.h>
13
-#import "RCTBridgeModule.h"
14
 #import "RNFetchBlobProgress.h"
10
 #import "RNFetchBlobProgress.h"
15
 #import "RNFetchBlobFS.h"
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
 typedef void(^CompletionHander)(NSURL * _Nullable location, NSURLResponse * _Nullable response, NSError * _Nullable error);
24
 typedef void(^CompletionHander)(NSURL * _Nullable location, NSURLResponse * _Nullable response, NSError * _Nullable error);
18
 typedef void(^DataTaskCompletionHander) (NSData * _Nullable resp, NSURLResponse * _Nullable response, NSError * _Nullable error);
25
 typedef void(^DataTaskCompletionHander) (NSData * _Nullable resp, NSURLResponse * _Nullable response, NSError * _Nullable error);
19
 
26
 

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

6
 //  Copyright © 2016 wkh237. All rights reserved.
6
 //  Copyright © 2016 wkh237. All rights reserved.
7
 //
7
 //
8
 
8
 
9
-#import "RCTLog.h"
9
+
10
 #import <Foundation/Foundation.h>
10
 #import <Foundation/Foundation.h>
11
-#import "RCTBridge.h"
12
 #import "RNFetchBlob.h"
11
 #import "RNFetchBlob.h"
13
-#import "RCTEventDispatcher.h"
14
 #import "RNFetchBlobFS.h"
12
 #import "RNFetchBlobFS.h"
15
-#import "RCTRootView.h"
16
 #import "RNFetchBlobNetwork.h"
13
 #import "RNFetchBlobNetwork.h"
17
 #import "RNFetchBlobConst.h"
14
 #import "RNFetchBlobConst.h"
18
 #import "RNFetchBlobReqBuilder.h"
15
 #import "RNFetchBlobReqBuilder.h"
20
 #import <CommonCrypto/CommonDigest.h>
17
 #import <CommonCrypto/CommonDigest.h>
21
 #import "RNFetchBlobProgress.h"
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
 //  HTTP request handler
34
 //  HTTP request handler

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

11
 #import "RNFetchBlobNetwork.h"
11
 #import "RNFetchBlobNetwork.h"
12
 #import "RNFetchBlobConst.h"
12
 #import "RNFetchBlobConst.h"
13
 #import "RNFetchBlobFS.h"
13
 #import "RNFetchBlobFS.h"
14
-#import "RCTLog.h"
15
 #import "IOS7Polyfill.h"
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
 @interface RNFetchBlobReqBuilder()
22
 @interface RNFetchBlobReqBuilder()
18
 {
23
 {
19
 
24