├── RNFileDownload.xcodeproj
├── project.xcworkspace
│ ├── contents.xcworkspacedata
│ ├── xcuserdata
│ │ └── plrthink.xcuserdatad
│ │ │ └── UserInterfaceState.xcuserstate
│ └── xcshareddata
│ │ └── RNFileDownload.xccheckout
├── xcuserdata
│ └── plrthink.xcuserdatad
│ │ └── xcschemes
│ │ ├── xcschememanagement.plist
│ │ └── RNFileDownload.xcscheme
└── project.pbxproj
├── RNFileDownload.h
├── .gitignore
├── .npmignore
├── package.json
├── index.ios.js
├── RNFileDownloadSessionManager.h
├── LICENSE
├── RNFileDownload.m
├── README.md
└── RNFileDownloadSessionManager.m
/RNFileDownload.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/RNFileDownload.xcodeproj/project.xcworkspace/xcuserdata/plrthink.xcuserdatad/UserInterfaceState.xcuserstate:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/plrthink/react-native-file-download/HEAD/RNFileDownload.xcodeproj/project.xcworkspace/xcuserdata/plrthink.xcuserdatad/UserInterfaceState.xcuserstate
--------------------------------------------------------------------------------
/RNFileDownload.h:
--------------------------------------------------------------------------------
1 | //
2 | // RNFileDownload.h
3 | // RNFileDownload
4 | //
5 | // Created by Perry Poon on 8/31/15.
6 | // Copyright (c) 2015 Perry Poon. All rights reserved.
7 | //
8 |
9 | #import "RCTBridgeModule.h"
10 |
11 | @interface RNFileDownload : NSObject
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # OSX
2 | #
3 | .DS_Store
4 |
5 | # Xcode
6 | #
7 | build/
8 | *.pbxuser
9 | !default.pbxuser
10 | *.mode1v3
11 | !default.mode1v3
12 | *.mode2v3
13 | !default.mode2v3
14 | *.perspectivev3
15 | !default.perspectivev3
16 | xcuserdata
17 | *.xccheckout
18 | *.moved-aside
19 | DerivedData
20 | *.hmap
21 | *.ipa
22 | *.xcuserstate
23 | project.xcworkspace
24 |
25 | # node.js
26 | #
27 | node_modules/
28 | npm-debug.log
29 |
--------------------------------------------------------------------------------
/.npmignore:
--------------------------------------------------------------------------------
1 | # OSX
2 | #
3 | .DS_Store
4 |
5 | # Xcode
6 | #
7 | build/
8 | *.pbxuser
9 | !default.pbxuser
10 | *.mode1v3
11 | !default.mode1v3
12 | *.mode2v3
13 | !default.mode2v3
14 | *.perspectivev3
15 | !default.perspectivev3
16 | xcuserdata
17 | *.xccheckout
18 | *.moved-aside
19 | DerivedData
20 | *.hmap
21 | *.ipa
22 | *.xcuserstate
23 | project.xcworkspace
24 |
25 | # node.js
26 | #
27 | node_modules/
28 | npm-debug.log
29 |
--------------------------------------------------------------------------------
/RNFileDownload.xcodeproj/xcuserdata/plrthink.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | RNFileDownload.xcscheme
8 |
9 | orderHint
10 | 0
11 |
12 |
13 | SuppressBuildableAutocreation
14 |
15 | D045FC4B1B94140B00C00AF7
16 |
17 | primary
18 |
19 |
20 | D045FC561B94140B00C00AF7
21 |
22 | primary
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "react-native-file-download",
3 | "version": "0.0.10",
4 | "description": "A simple file download module for react-native",
5 | "main": "index.ios.js",
6 | "scripts": {
7 | "test": "echo \"Error: no test specified\" && exit 1"
8 | },
9 | "repository": {
10 | "type": "git",
11 | "url": "git@github.com:plrthink/react-native-file-download.git"
12 | },
13 | "keywords": [
14 | "react-component",
15 | "react-native",
16 | "ios",
17 | "file-download"
18 | ],
19 | "devDependencies": {
20 | "react-native": "^0.8.0"
21 | },
22 | "author": "Perry Poon (https://github.com/plrthink)",
23 | "license": "MIT",
24 | "dependencies": {
25 | "es6-promisify": "^3.0.0"
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/index.ios.js:
--------------------------------------------------------------------------------
1 | 'use strict'
2 |
3 | import {
4 | NativeModules,
5 | NativeAppEventEmitter
6 | } from 'react-native';
7 | var RNFileDownload = NativeModules.RNFileDownload;
8 | var promisify = require("es6-promisify")
9 |
10 | let progressEventName = 'RNFileDownloadProgress'
11 | let progressEventTable = {}
12 | var _download = promisify(RNFileDownload.download)
13 |
14 | var _error = (err) => {
15 | throw err
16 | }
17 |
18 | var FileDownload = {
19 | download(source, target, fileName=null, headers={}) {
20 | return _download(source, target, fileName, headers)
21 | .catch(_error)
22 | },
23 | addListener(source, callback) {
24 | return NativeAppEventEmitter.addListener(progressEventName + source, callback)
25 | }
26 | }
27 |
28 | module.exports = FileDownload
29 |
--------------------------------------------------------------------------------
/RNFileDownloadSessionManager.h:
--------------------------------------------------------------------------------
1 | //
2 | // RNFileDownloadSessionManager.h
3 | // RNFileDownload
4 | //
5 | // Created by Luavis Kang on 4/2/16.
6 | // Copyright © 2016 Perry Poon. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "RCTBridge.h"
11 | #import "RCTEventDispatcher.h"
12 | #import "RNFileDownload.h"
13 |
14 | #define RANDOM_FILENAME_LENGTH 10
15 |
16 | @interface RNFileDownloadSessionManager : NSObject
17 | @property (nonatomic, strong) RCTResponseSenderBlock callback;
18 | @property (nonatomic, strong) RCTBridge *bridge;
19 | @property (nonatomic, strong, readonly) NSString *targetPath;
20 | @property (nonatomic, strong, readonly) NSString *downloadFileName;
21 |
22 | - (instancetype)initWithTargetPath:(NSString *)targetPath downloadFileName:(NSString *)fileName bridge:(RCTBridge *)bridge callback:(RCTResponseSenderBlock)callback;
23 |
24 | @end
25 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2015 Perry Poon
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/RNFileDownload.xcodeproj/project.xcworkspace/xcshareddata/RNFileDownload.xccheckout:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDESourceControlProjectFavoriteDictionaryKey
6 |
7 | IDESourceControlProjectIdentifier
8 | 8AEE95D2-55F7-44EB-B49C-5BCA9E4416C9
9 | IDESourceControlProjectName
10 | RNFileDownload
11 | IDESourceControlProjectOriginsDictionary
12 |
13 | 4C61565C22E5D57386E06970C4CA57C878AF06B8
14 | bitbucket.org:yuanyiz/mb-ios.git
15 |
16 | IDESourceControlProjectPath
17 | node_modules/react-native-file-download/RNFileDownload.xcodeproj
18 | IDESourceControlProjectRelativeInstallPathDictionary
19 |
20 | 4C61565C22E5D57386E06970C4CA57C878AF06B8
21 | ../../../..
22 |
23 | IDESourceControlProjectURL
24 | bitbucket.org:yuanyiz/mb-ios.git
25 | IDESourceControlProjectVersion
26 | 111
27 | IDESourceControlProjectWCCIdentifier
28 | 4C61565C22E5D57386E06970C4CA57C878AF06B8
29 | IDESourceControlProjectWCConfigurations
30 |
31 |
32 | IDESourceControlRepositoryExtensionIdentifierKey
33 | public.vcs.git
34 | IDESourceControlWCCIdentifierKey
35 | 4C61565C22E5D57386E06970C4CA57C878AF06B8
36 | IDESourceControlWCCName
37 | mb-ios
38 |
39 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/RNFileDownload.m:
--------------------------------------------------------------------------------
1 | //
2 | // RNFileDownload.m
3 | // RNFileDownload
4 | //
5 | // Created by Perry Poon on 8/31/15.
6 | // Copyright (c) 2015 Perry Poon. All rights reserved.
7 | //
8 |
9 | #import "RNFileDownload.h"
10 | #import "RNFileDownloadSessionManager.h"
11 |
12 | @implementation RNFileDownload
13 | @synthesize bridge = _bridge;
14 |
15 | RCT_EXPORT_MODULE();
16 |
17 | RCT_EXPORT_METHOD(download:(NSString *)source targetPath:(NSString *)targetPath downloadFileName:(NSString *)fileName headers:(NSDictionary *)headers callback:(RCTResponseSenderBlock)callback) {
18 | if(!source)
19 | callback(@[@"source need to be not null"]);
20 | if(!targetPath)
21 | callback(@[@"targetPath need to be not null"]);
22 |
23 | NSURL *URL = [NSURL URLWithString:source];
24 | NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:URL];
25 | for (NSString *key in headers.allKeys){
26 | [request setValue:headers[key] forHTTPHeaderField:key];
27 | }
28 |
29 | RNFileDownloadSessionManager *manager = [[RNFileDownloadSessionManager alloc] initWithTargetPath:targetPath
30 | downloadFileName:fileName
31 | bridge:self.bridge
32 | callback:callback];
33 |
34 | NSURLSession *session = [NSURLSession sessionWithConfiguration:[NSURLSession sharedSession].delegate
35 | delegate:manager
36 | delegateQueue:[NSOperationQueue mainQueue]];
37 |
38 | NSURLSessionDownloadTask *downloadTask = [session downloadTaskWithRequest:request];
39 |
40 | [downloadTask resume];
41 | }
42 |
43 | @end
44 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | ## This repo is deprecated in favor of [react-native-fs](https://github.com/johanneslumpe/react-native-fs#promise-downloadfileoptions)
2 |
3 | # React Native File Download [](https://www.npmjs.org/package/react-native-file-download) [](https://badge.fury.io/js/react-native-file-download)
4 |
5 | > Native file download utility for react-native
6 |
7 | ##### *Note that does not support Android.*
8 |
9 | ## Installation
10 |
11 | ```bash
12 | npm install react-native-file-download --save
13 | ```
14 |
15 | ## Getting started - iOS
16 |
17 | 1. In Xcode, in the project navigator right click `Libraries` ➜ `Add Files to [your project's name]`
18 | 2. Go to `node_modules` ➜ `react-native-file-download` and add `RNFileDownload.xcodeproj`
19 | 3. Add `libRNFileDownload.a` (from 'Products' under RNFileDownload.xcodeproj) to your project's `Build Phases` ➜ `Link Binary With Libraries` phase
20 | 4. Look for Header Search Paths and make sure it contains both `$(SRCROOT)/../react-native/React` and `$(SRCROOT)/../../React` - mark both as recursive
21 | 5. Run your project (`CMD+R`)
22 |
23 | ## Usage
24 |
25 | require it in your file
26 |
27 | ```js
28 | const FileDownload = require('react-native-file-download')
29 | ```
30 |
31 | you may also want to use something like [react-native-fs](https://github.com/johanneslumpe/react-native-fs) to access the file system (check its repo for more information)
32 |
33 | ```js
34 | const RNFS = require('react-native-fs')
35 | ```
36 |
37 | ## API
38 |
39 | **download(source: string, target: string): Promise**
40 |
41 | > download file from source to target
42 |
43 | Example
44 |
45 | ```js
46 | const URL = '/path/to/remote/file'
47 | const DEST = RNFS.DocumentDirectoryPath
48 | const fileName = 'zip.zip'
49 | const headers = {
50 | 'Accept-Language': 'en-US'
51 | }
52 |
53 | FileDownload.download(URL, DEST, fileName, headers)
54 | .then((response) => {
55 | console.log(`downloaded! file saved to: ${response}`)
56 | })
57 | .catch((error) => {
58 | console.log(error)
59 | })
60 | ```
61 |
62 | **addListener(source: string, callback: function): EmitterSubscription**
63 |
64 | > event listener for progress of download
65 |
66 | Example
67 |
68 | ```js
69 | const URL = '/path/to/remote/file'
70 | const DEST = RNFS.DocumentDirectoryPath
71 | const fileName = 'zip.zip'
72 | const headers = {
73 | 'Accept-Language': 'en-US'
74 | }
75 |
76 | FileDownload.addListener(URL, (info) => {
77 | console.log(`complete ${(info.totalBytesWritten / info.totalBytesExpectedToWrite * 100)}%`);
78 | });
79 |
80 | FileDownload.download(URL, DEST, fileName, headers)
81 | .then((response) => {
82 | console.log(`downloaded! file saved to: ${response}`)
83 | })
84 | .catch((error) => {
85 | console.log(error)
86 | })
87 | ```
88 |
--------------------------------------------------------------------------------
/RNFileDownloadSessionManager.m:
--------------------------------------------------------------------------------
1 | //
2 | // RNFileDownloadSessionManager.m
3 | // RNFileDownload
4 | //
5 | // Created by Luavis Kang on 4/2/16.
6 | // Copyright © 2016 Perry Poon. All rights reserved.
7 | //
8 |
9 | #import "RNFileDownloadSessionManager.h"
10 |
11 | @implementation RNFileDownloadSessionManager
12 |
13 | - (instancetype)initWithTargetPath:(NSString *)targetPath downloadFileName:(NSString *)fileName bridge:(RCTBridge *)bridge callback:(RCTResponseSenderBlock)callback
14 | {
15 | self = [super init];
16 | if (self) {
17 | self.bridge = bridge;
18 | self.callback = callback;
19 | _targetPath = targetPath;
20 | _downloadFileName = fileName;
21 | }
22 | return self;
23 | }
24 |
25 | #pragma mark - Session delegates
26 |
27 | - (void)URLSession:(NSURLSession *)session downloadTask:(NSURLSessionDownloadTask *)downloadTask didWriteData:(int64_t)bytesWritten totalBytesWritten:(int64_t)totalBytesWritten totalBytesExpectedToWrite:(int64_t)totalBytesExpectedToWrite {
28 | if(_downloadFileName == nil) {
29 | _downloadFileName = downloadTask.response.suggestedFilename;
30 |
31 | if(!self.downloadFileName)
32 | _downloadFileName = [self randomStringWithLength:RANDOM_FILENAME_LENGTH];
33 | }
34 |
35 | if(bytesWritten > 0 && self.bridge != nil)
36 | [self.bridge.eventDispatcher sendAppEventWithName:[@"RNFileDownloadProgress" stringByAppendingString:downloadTask.originalRequest.URL.absoluteString]
37 | body:@{
38 | @"filename": self.downloadFileName,
39 | @"sourceUrl": downloadTask.originalRequest.URL.absoluteString,
40 | @"targetPath": self.targetPath,
41 | @"bytesWritten": @(bytesWritten),
42 | @"totalBytesWritten": @(totalBytesWritten),
43 | @"totalBytesExpectedToWrite": @(totalBytesExpectedToWrite),
44 | }];
45 | }
46 |
47 | - (void)URLSession:(NSURLSession *)session downloadTask:(NSURLSessionDownloadTask *)downloadTask didFinishDownloadingToURL:(NSURL *)location {
48 | NSURL *targetDirectoryURL = [NSURL fileURLWithPath:self.targetPath];
49 | NSURL *targetURL = [targetDirectoryURL URLByAppendingPathComponent:self.downloadFileName];
50 | [[NSFileManager defaultManager] moveItemAtURL:location
51 | toURL:targetURL
52 | error:nil];
53 | self.callback(@[[NSNull null], targetURL.absoluteString]);
54 | }
55 |
56 | - (void)URLSession:(NSURLSession *)session task:(NSURLSessionTask *)task didCompleteWithError:(NSError *)error {
57 | if([error description] != nil) {
58 | NSLog(@"RNFileDownload error: %@", [error description]);
59 | self.callback(@[[error description]]);
60 | }
61 | }
62 |
63 | #pragma mark - Tools
64 |
65 | - (NSString *)randomStringWithLength: (int) len {
66 | static NSString *letters = @"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
67 | NSMutableString *randomString = [NSMutableString stringWithCapacity: len];
68 |
69 | for (int i=0; i
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
29 |
35 |
36 |
37 |
38 |
39 |
44 |
45 |
47 |
53 |
54 |
55 |
56 |
57 |
63 |
64 |
65 |
66 |
75 |
76 |
82 |
83 |
84 |
85 |
86 |
87 |
93 |
94 |
100 |
101 |
102 |
103 |
105 |
106 |
109 |
110 |
111 |
--------------------------------------------------------------------------------
/RNFileDownload.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 46;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | A75BB64E1CAF99E600650394 /* RNFileDownloadSessionManager.m in Sources */ = {isa = PBXBuildFile; fileRef = A75BB64D1CAF99E600650394 /* RNFileDownloadSessionManager.m */; };
11 | D045FC501B94140B00C00AF7 /* RNFileDownload.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = D045FC4F1B94140B00C00AF7 /* RNFileDownload.h */; };
12 | D045FC521B94140B00C00AF7 /* RNFileDownload.m in Sources */ = {isa = PBXBuildFile; fileRef = D045FC511B94140B00C00AF7 /* RNFileDownload.m */; };
13 | /* End PBXBuildFile section */
14 |
15 | /* Begin PBXCopyFilesBuildPhase section */
16 | D045FC4A1B94140B00C00AF7 /* CopyFiles */ = {
17 | isa = PBXCopyFilesBuildPhase;
18 | buildActionMask = 2147483647;
19 | dstPath = "include/$(PRODUCT_NAME)";
20 | dstSubfolderSpec = 16;
21 | files = (
22 | D045FC501B94140B00C00AF7 /* RNFileDownload.h in CopyFiles */,
23 | );
24 | runOnlyForDeploymentPostprocessing = 0;
25 | };
26 | /* End PBXCopyFilesBuildPhase section */
27 |
28 | /* Begin PBXFileReference section */
29 | A75BB64C1CAF99E600650394 /* RNFileDownloadSessionManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RNFileDownloadSessionManager.h; sourceTree = ""; };
30 | A75BB64D1CAF99E600650394 /* RNFileDownloadSessionManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RNFileDownloadSessionManager.m; sourceTree = ""; };
31 | D045FC4C1B94140B00C00AF7 /* libRNFileDownload.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRNFileDownload.a; sourceTree = BUILT_PRODUCTS_DIR; };
32 | D045FC4F1B94140B00C00AF7 /* RNFileDownload.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RNFileDownload.h; sourceTree = ""; };
33 | D045FC511B94140B00C00AF7 /* RNFileDownload.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RNFileDownload.m; sourceTree = ""; };
34 | D045FC5D1B94140B00C00AF7 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
35 | /* End PBXFileReference section */
36 |
37 | /* Begin PBXFrameworksBuildPhase section */
38 | D045FC491B94140B00C00AF7 /* Frameworks */ = {
39 | isa = PBXFrameworksBuildPhase;
40 | buildActionMask = 2147483647;
41 | files = (
42 | );
43 | runOnlyForDeploymentPostprocessing = 0;
44 | };
45 | /* End PBXFrameworksBuildPhase section */
46 |
47 | /* Begin PBXGroup section */
48 | D045FC431B94140B00C00AF7 = {
49 | isa = PBXGroup;
50 | children = (
51 | D045FC4F1B94140B00C00AF7 /* RNFileDownload.h */,
52 | D045FC511B94140B00C00AF7 /* RNFileDownload.m */,
53 | A75BB64C1CAF99E600650394 /* RNFileDownloadSessionManager.h */,
54 | A75BB64D1CAF99E600650394 /* RNFileDownloadSessionManager.m */,
55 | D045FC5B1B94140B00C00AF7 /* RNFileDownloadTests */,
56 | D045FC4D1B94140B00C00AF7 /* Products */,
57 | );
58 | sourceTree = "";
59 | };
60 | D045FC4D1B94140B00C00AF7 /* Products */ = {
61 | isa = PBXGroup;
62 | children = (
63 | D045FC4C1B94140B00C00AF7 /* libRNFileDownload.a */,
64 | );
65 | name = Products;
66 | sourceTree = "";
67 | };
68 | D045FC5B1B94140B00C00AF7 /* RNFileDownloadTests */ = {
69 | isa = PBXGroup;
70 | children = (
71 | D045FC5C1B94140B00C00AF7 /* Supporting Files */,
72 | );
73 | path = RNFileDownloadTests;
74 | sourceTree = "";
75 | };
76 | D045FC5C1B94140B00C00AF7 /* Supporting Files */ = {
77 | isa = PBXGroup;
78 | children = (
79 | D045FC5D1B94140B00C00AF7 /* Info.plist */,
80 | );
81 | name = "Supporting Files";
82 | sourceTree = "";
83 | };
84 | /* End PBXGroup section */
85 |
86 | /* Begin PBXNativeTarget section */
87 | D045FC4B1B94140B00C00AF7 /* RNFileDownload */ = {
88 | isa = PBXNativeTarget;
89 | buildConfigurationList = D045FC601B94140B00C00AF7 /* Build configuration list for PBXNativeTarget "RNFileDownload" */;
90 | buildPhases = (
91 | D045FC481B94140B00C00AF7 /* Sources */,
92 | D045FC491B94140B00C00AF7 /* Frameworks */,
93 | D045FC4A1B94140B00C00AF7 /* CopyFiles */,
94 | );
95 | buildRules = (
96 | );
97 | dependencies = (
98 | );
99 | name = RNFileDownload;
100 | productName = RNFileDownload;
101 | productReference = D045FC4C1B94140B00C00AF7 /* libRNFileDownload.a */;
102 | productType = "com.apple.product-type.library.static";
103 | };
104 | /* End PBXNativeTarget section */
105 |
106 | /* Begin PBXProject section */
107 | D045FC441B94140B00C00AF7 /* Project object */ = {
108 | isa = PBXProject;
109 | attributes = {
110 | LastUpgradeCheck = 0640;
111 | ORGANIZATIONNAME = "Perry Poon";
112 | TargetAttributes = {
113 | D045FC4B1B94140B00C00AF7 = {
114 | CreatedOnToolsVersion = 6.4;
115 | };
116 | };
117 | };
118 | buildConfigurationList = D045FC471B94140B00C00AF7 /* Build configuration list for PBXProject "RNFileDownload" */;
119 | compatibilityVersion = "Xcode 3.2";
120 | developmentRegion = English;
121 | hasScannedForEncodings = 0;
122 | knownRegions = (
123 | en,
124 | );
125 | mainGroup = D045FC431B94140B00C00AF7;
126 | productRefGroup = D045FC4D1B94140B00C00AF7 /* Products */;
127 | projectDirPath = "";
128 | projectRoot = "";
129 | targets = (
130 | D045FC4B1B94140B00C00AF7 /* RNFileDownload */,
131 | );
132 | };
133 | /* End PBXProject section */
134 |
135 | /* Begin PBXSourcesBuildPhase section */
136 | D045FC481B94140B00C00AF7 /* Sources */ = {
137 | isa = PBXSourcesBuildPhase;
138 | buildActionMask = 2147483647;
139 | files = (
140 | A75BB64E1CAF99E600650394 /* RNFileDownloadSessionManager.m in Sources */,
141 | D045FC521B94140B00C00AF7 /* RNFileDownload.m in Sources */,
142 | );
143 | runOnlyForDeploymentPostprocessing = 0;
144 | };
145 | /* End PBXSourcesBuildPhase section */
146 |
147 | /* Begin XCBuildConfiguration section */
148 | D045FC5E1B94140B00C00AF7 /* Debug */ = {
149 | isa = XCBuildConfiguration;
150 | buildSettings = {
151 | ALWAYS_SEARCH_USER_PATHS = NO;
152 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
153 | CLANG_CXX_LIBRARY = "libc++";
154 | CLANG_ENABLE_MODULES = YES;
155 | CLANG_ENABLE_OBJC_ARC = YES;
156 | CLANG_WARN_BOOL_CONVERSION = YES;
157 | CLANG_WARN_CONSTANT_CONVERSION = YES;
158 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
159 | CLANG_WARN_EMPTY_BODY = YES;
160 | CLANG_WARN_ENUM_CONVERSION = YES;
161 | CLANG_WARN_INT_CONVERSION = YES;
162 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
163 | CLANG_WARN_UNREACHABLE_CODE = YES;
164 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
165 | COPY_PHASE_STRIP = NO;
166 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
167 | ENABLE_STRICT_OBJC_MSGSEND = YES;
168 | GCC_C_LANGUAGE_STANDARD = gnu99;
169 | GCC_DYNAMIC_NO_PIC = NO;
170 | GCC_NO_COMMON_BLOCKS = YES;
171 | GCC_OPTIMIZATION_LEVEL = 0;
172 | GCC_PREPROCESSOR_DEFINITIONS = (
173 | "DEBUG=1",
174 | "$(inherited)",
175 | );
176 | GCC_SYMBOLS_PRIVATE_EXTERN = NO;
177 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
178 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
179 | GCC_WARN_UNDECLARED_SELECTOR = YES;
180 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
181 | GCC_WARN_UNUSED_FUNCTION = YES;
182 | GCC_WARN_UNUSED_VARIABLE = YES;
183 | HEADER_SEARCH_PATHS = (
184 | "$(inherited)",
185 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
186 | "$(SRCROOT)/../react-native/React/**",
187 | "$(SRCROOT)/../../React/**",
188 | );
189 | IPHONEOS_DEPLOYMENT_TARGET = 8.4;
190 | MTL_ENABLE_DEBUG_INFO = YES;
191 | ONLY_ACTIVE_ARCH = YES;
192 | SDKROOT = iphoneos;
193 | };
194 | name = Debug;
195 | };
196 | D045FC5F1B94140B00C00AF7 /* Release */ = {
197 | isa = XCBuildConfiguration;
198 | buildSettings = {
199 | ALWAYS_SEARCH_USER_PATHS = NO;
200 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
201 | CLANG_CXX_LIBRARY = "libc++";
202 | CLANG_ENABLE_MODULES = YES;
203 | CLANG_ENABLE_OBJC_ARC = YES;
204 | CLANG_WARN_BOOL_CONVERSION = YES;
205 | CLANG_WARN_CONSTANT_CONVERSION = YES;
206 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
207 | CLANG_WARN_EMPTY_BODY = YES;
208 | CLANG_WARN_ENUM_CONVERSION = YES;
209 | CLANG_WARN_INT_CONVERSION = YES;
210 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
211 | CLANG_WARN_UNREACHABLE_CODE = YES;
212 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
213 | COPY_PHASE_STRIP = NO;
214 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
215 | ENABLE_NS_ASSERTIONS = NO;
216 | ENABLE_STRICT_OBJC_MSGSEND = YES;
217 | GCC_C_LANGUAGE_STANDARD = gnu99;
218 | GCC_NO_COMMON_BLOCKS = YES;
219 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
220 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
221 | GCC_WARN_UNDECLARED_SELECTOR = YES;
222 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
223 | GCC_WARN_UNUSED_FUNCTION = YES;
224 | GCC_WARN_UNUSED_VARIABLE = YES;
225 | HEADER_SEARCH_PATHS = (
226 | "$(inherited)",
227 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
228 | "$(SRCROOT)/../react-native/React/**",
229 | "$(SRCROOT)/../../React/**",
230 | );
231 | IPHONEOS_DEPLOYMENT_TARGET = 8.4;
232 | MTL_ENABLE_DEBUG_INFO = NO;
233 | SDKROOT = iphoneos;
234 | VALIDATE_PRODUCT = YES;
235 | };
236 | name = Release;
237 | };
238 | D045FC611B94140B00C00AF7 /* Debug */ = {
239 | isa = XCBuildConfiguration;
240 | buildSettings = {
241 | OTHER_LDFLAGS = "-ObjC";
242 | PRODUCT_NAME = "$(TARGET_NAME)";
243 | SKIP_INSTALL = YES;
244 | };
245 | name = Debug;
246 | };
247 | D045FC621B94140B00C00AF7 /* Release */ = {
248 | isa = XCBuildConfiguration;
249 | buildSettings = {
250 | OTHER_LDFLAGS = "-ObjC";
251 | PRODUCT_NAME = "$(TARGET_NAME)";
252 | SKIP_INSTALL = YES;
253 | };
254 | name = Release;
255 | };
256 | /* End XCBuildConfiguration section */
257 |
258 | /* Begin XCConfigurationList section */
259 | D045FC471B94140B00C00AF7 /* Build configuration list for PBXProject "RNFileDownload" */ = {
260 | isa = XCConfigurationList;
261 | buildConfigurations = (
262 | D045FC5E1B94140B00C00AF7 /* Debug */,
263 | D045FC5F1B94140B00C00AF7 /* Release */,
264 | );
265 | defaultConfigurationIsVisible = 0;
266 | defaultConfigurationName = Release;
267 | };
268 | D045FC601B94140B00C00AF7 /* Build configuration list for PBXNativeTarget "RNFileDownload" */ = {
269 | isa = XCConfigurationList;
270 | buildConfigurations = (
271 | D045FC611B94140B00C00AF7 /* Debug */,
272 | D045FC621B94140B00C00AF7 /* Release */,
273 | );
274 | defaultConfigurationIsVisible = 0;
275 | defaultConfigurationName = Release;
276 | };
277 | /* End XCConfigurationList section */
278 | };
279 | rootObject = D045FC441B94140B00C00AF7 /* Project object */;
280 | }
281 |
--------------------------------------------------------------------------------