├── .gitignore ├── LICENSE ├── RCTLocalImageManager.m ├── README.md ├── example └── ExampleProject │ ├── .flowconfig │ ├── .gitignore │ ├── .npmignore │ ├── ExampleProject.xcodeproj │ ├── project.pbxproj │ └── xcshareddata │ │ └── xcschemes │ │ └── ExampleProject.xcscheme │ ├── ExampleProjectTests │ ├── ExampleProjectTests.m │ └── Info.plist │ ├── iOS │ ├── AppDelegate.h │ ├── AppDelegate.m │ ├── Base.lproj │ │ └── LaunchScreen.xib │ ├── Images.xcassets │ │ └── AppIcon.appiconset │ │ │ └── Contents.json │ ├── Info.plist │ ├── main.jsbundle │ └── main.m │ ├── index.ios.js │ └── package.json └── package.json /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | 5 | # Runtime data 6 | pids 7 | *.pid 8 | *.seed 9 | 10 | # Directory for instrumented libs generated by jscoverage/JSCover 11 | lib-cov 12 | 13 | # Coverage directory used by tools like istanbul 14 | coverage 15 | 16 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 17 | .grunt 18 | 19 | # node-waf configuration 20 | .lock-wscript 21 | 22 | # Compiled binary addons (http://nodejs.org/api/addons.html) 23 | build/Release 24 | 25 | # Dependency directory 26 | # https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git 27 | node_modules 28 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Asa Miller 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 | 23 | -------------------------------------------------------------------------------- /RCTLocalImageManager.m: -------------------------------------------------------------------------------- 1 | // 2 | // RCTLocalImageManager.m 3 | // 4 | // Created by Asa Miller and Eric Hayes on 6/10/15. 5 | // Copyright (c) 2015 Asa Miller. All rights reserved. 6 | // 7 | 8 | #import 9 | #import 10 | #import 11 | #import "RCTBridgeModule.h" 12 | #import "RCTUtils.h" 13 | 14 | 15 | #define kImageCacheFolder @"image_cache" 16 | 17 | @interface LocalImageManager : NSObject 18 | - (void)resize:(NSDictionary *)input callback:(RCTResponseSenderBlock)callback; 19 | - (void)remove:(NSString *)pathFileToDelete callback:(RCTResponseSenderBlock)callback; 20 | - (void)download:(NSDictionary *)input callback:(RCTResponseSenderBlock)callback; 21 | 22 | - (void)downloadCached:(NSString *)pathFileToCache callback:(RCTResponseSenderBlock)callback; 23 | - (void)removeCached:(NSString *)pathFileToDelete callback:(RCTResponseSenderBlock)callback; 24 | - (void)clearCache:(NSString *)unused callback:(RCTResponseSenderBlock)callback; 25 | 26 | @end 27 | 28 | @implementation LocalImageManager 29 | 30 | 31 | RCT_EXPORT_MODULE(); 32 | 33 | // Available as NativeModules.LocalImageManager.resize 34 | RCT_EXPORT_METHOD(resize:(NSDictionary *)input callback:(RCTResponseSenderBlock)callback) 35 | { 36 | NSURL *assetUrl = [[NSURL alloc] initWithString:input[@"uri"]]; 37 | CGFloat width = [input[@"width"] floatValue]; 38 | CGFloat height = [input[@"height"] floatValue]; 39 | CGFloat quality = [input[@"quality"] floatValue]; 40 | NSString *outputName = input[@"filename"]; 41 | 42 | ALAssetsLibrary *library = [[ALAssetsLibrary alloc] init]; 43 | [library assetForURL:assetUrl 44 | resultBlock:^(ALAsset *asset) { 45 | // grab the image from the asset 46 | ALAssetRepresentation *rep = [asset defaultRepresentation]; 47 | CGImageRef imageRef = [rep fullResolutionImage]; 48 | 49 | // make a UIImage out of it, so we can draw it into our context 50 | UIImage *sourceImage = [UIImage imageWithCGImage:imageRef scale:1.0f orientation:[rep orientation]]; 51 | 52 | CGRect rect = CGRectMake(0, 0, width, height); 53 | // make a new graphics context (think layer) 54 | UIGraphicsBeginImageContextWithOptions(rect.size, YES, 1.0f); 55 | // draw our source image to size in the layer 56 | [sourceImage drawInRect:rect]; 57 | UIImage * resizedImage = UIGraphicsGetImageFromCurrentImageContext(); 58 | UIGraphicsEndImageContext(); 59 | 60 | // convert the image to DATA (and jpeg it to the requested quality) 61 | NSData *data = UIImageJPEGRepresentation(resizedImage, quality); 62 | 63 | // write it to disk 64 | NSString *path = [self getDestLocation:outputName]; 65 | [data writeToFile:path atomically:YES]; 66 | 67 | // return the location we specified 68 | callback(@[path]); 69 | } 70 | failureBlock:^(NSError *error) { 71 | callback(@[RCTMakeError(@"Error resizing image", nil, nil)]); 72 | } 73 | ]; 74 | } 75 | 76 | // Available as NativeModules.LocalImageManager.remove 77 | RCT_EXPORT_METHOD(remove:(NSString *)pathFileToDelete callback:(RCTResponseSenderBlock)callback) 78 | { 79 | [[NSFileManager defaultManager] removeItemAtPath:pathFileToDelete error:nil]; 80 | } 81 | 82 | 83 | // Available as NativeModules.LocalImageManager.download 84 | RCT_EXPORT_METHOD(download:(NSDictionary *)input callback:(RCTResponseSenderBlock)callback) 85 | { 86 | NSURL *assetUrl = [NSURL URLWithString:input[@"uri"]]; 87 | NSString *outputName = input[@"filename"]; 88 | 89 | NSData *data = [NSData dataWithContentsOfURL:assetUrl]; 90 | if ( data == nil ) { 91 | callback(@[RCTMakeError(@"uri did not return any data", nil, nil)]); 92 | 93 | } else { 94 | NSString *path = [self getDestLocation:outputName]; 95 | [data writeToFile:path atomically:YES]; 96 | 97 | // return the location we specified 98 | callback(@[path]); 99 | } 100 | } 101 | 102 | 103 | #pragma mark - Cached calls 104 | 105 | 106 | // Available as NativeModules.LocalImageManager.downloadCached 107 | RCT_EXPORT_METHOD(downloadCached:(NSString *)pathFileToCache callback:(RCTResponseSenderBlock)callback) 108 | { 109 | NSString *path = pathFileToCache; 110 | if ( path.length <= 0 ) { 111 | callback(@[RCTMakeError(@"invalid uri", nil, nil)]); 112 | } 113 | 114 | // we will be returning this path 115 | NSString *fullPath = [self getFullPathForFilePath:path]; 116 | 117 | // first, see if we have it 118 | if ( [self imageExists:path] ) { 119 | [self touchCachedImage:path]; 120 | callback(@[fullPath]); 121 | return; 122 | } 123 | 124 | // nope, gotta download it 125 | 126 | NSURL *assetUrl = [NSURL URLWithString:path]; 127 | NSData *data = [NSData dataWithContentsOfURL:assetUrl]; 128 | if ( data == nil ) { 129 | callback(@[RCTMakeError(@"uri did not return any data", nil, nil)]); 130 | 131 | } else { 132 | [self storeImageData:data forPath:path]; 133 | 134 | // return the location we specified 135 | callback(@[path]); 136 | } 137 | } 138 | 139 | // Available as NativeModules.LocalImageManager.removeCached 140 | RCT_EXPORT_METHOD(removeCached:(NSString *)pathFileToDelete callback:(RCTResponseSenderBlock)callback) 141 | { 142 | [self clearImage:pathFileToDelete]; 143 | } 144 | 145 | // Available as NativeModules.LocalImageManager.clearCache 146 | RCT_EXPORT_METHOD(clearCache:(NSString *)unused callback:(RCTResponseSenderBlock)callback) 147 | { 148 | [self clearImageCache]; 149 | } 150 | 151 | 152 | #pragma mark - Internal Cached Image Manager 153 | 154 | 155 | // fetch the desired Image version from afar (then cache it) 156 | - (BOOL)imageExists:(NSString *)path; 157 | { 158 | NSString *fullPath = [self getFullPathForFilePath:path]; 159 | 160 | BOOL isDir; 161 | return [[NSFileManager defaultManager] fileExistsAtPath:fullPath isDirectory:&isDir]; 162 | } 163 | 164 | // fetch the desired Image version from afar (then cache it) 165 | - (void)storeImageData:(NSData *)imageData forPath:(NSString *)path; 166 | { 167 | NSString *fullPath = [self getFullPathForFilePath:path]; 168 | 169 | [imageData writeToFile:fullPath atomically:YES]; 170 | } 171 | 172 | - (NSData *)loadImageData:(NSString *)path; 173 | { 174 | NSString *fullPath = [self getFullPathForFilePath:path]; 175 | 176 | NSData *data = [NSData dataWithContentsOfFile:fullPath]; 177 | if ( data ) { 178 | [self touchCachedImage:path]; 179 | } 180 | return data; 181 | } 182 | 183 | // load from cache, the requested Image version, nil if not present 184 | - (UIImage *)loadImage:(NSString *)path; 185 | { 186 | if ( path.length == 0 ) return nil; 187 | 188 | NSData *data = [self loadImageData:path]; 189 | if ( data ) { 190 | [self touchCachedImage:path]; 191 | return [UIImage imageWithData:data]; 192 | } else { 193 | return nil; 194 | } 195 | } 196 | 197 | - (void)storeImage:(UIImage *)image forPath:(NSString *)path; 198 | { 199 | NSData *data = UIImageJPEGRepresentation(image, 1.0); 200 | 201 | [self storeImageData:data forPath:path]; 202 | } 203 | 204 | - (void)touchCachedImage:(NSString *)path; 205 | { 206 | NSString *fullPath = [self getFullPathForFilePath:path]; 207 | 208 | NSDictionary *attribs = @{NSFileModificationDate:[NSDate date]}; 209 | NSError *err; 210 | [[NSFileManager defaultManager] setAttributes:attribs ofItemAtPath:fullPath error:&err]; 211 | } 212 | 213 | // clear, from cache, the desired Image version 214 | - (void)clearImage:(NSString *)path; 215 | { 216 | NSString *fullPath = [self getFullPathForFilePath:path]; 217 | 218 | [[NSFileManager defaultManager] removeItemAtPath:fullPath error:nil]; 219 | } 220 | 221 | // clear the cache 222 | - (void)clearImageCache; 223 | { 224 | [[NSFileManager defaultManager] removeItemAtPath:[self getCacheFolderPath] error:nil]; 225 | } 226 | 227 | 228 | 229 | #pragma mark - Internal Helpers 230 | 231 | - (NSString *)getFullPathForFilePath:(NSString *)filePath 232 | { 233 | NSString *cachePath = [self getCacheFolderPath]; 234 | NSString *filename = [filePath stringByReplacingOccurrencesOfString:@"/" withString:@"~"]; 235 | filename = [filename stringByReplacingOccurrencesOfString:@":" withString:@"~"]; 236 | NSString *fullPath = [cachePath stringByAppendingPathComponent:filename]; 237 | 238 | return fullPath; 239 | } 240 | 241 | - (NSString *)getCacheFolderPath 242 | { 243 | NSArray *cachedirs = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES); 244 | NSString *cachedir = cachedirs[0]; 245 | 246 | NSString *cachePath = [cachedir stringByAppendingPathComponent:kImageCacheFolder]; 247 | 248 | //make sure it exists 249 | [[NSFileManager defaultManager] createDirectoryAtPath:cachePath withIntermediateDirectories:YES attributes:nil error:nil]; 250 | 251 | return cachePath; 252 | } 253 | 254 | - (NSString *)getDestLocation:(NSString *)filename 255 | { 256 | NSArray *paths = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES); 257 | NSString *documentsDirectory = [paths objectAtIndex:0]; 258 | 259 | return [documentsDirectory stringByAppendingPathComponent:filename]; 260 | } 261 | 262 | @end -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## react-native-local-image-manager 2 | A React Native module for downloading and resizing images natively. 3 | 4 | ### Add it to your project 5 | 1. Run `npm install react-native-local-image-manager --save` 6 | 2. Add `RCTLocalImageManager.m` to your Xcode project. 7 | 8 | ### Usage 9 | ```javascript 10 | var { NativeModules } = require('react-native'); 11 | var LocalImageManager = require('NativeModules').LocalImageManager; 12 | 13 | // Resize a local image 14 | var options = { 15 | uri: '', 16 | width: 100, 17 | height: 100, 18 | quality: 0.5, 19 | filename: 'myfile.jpg', 20 | }; 21 | 22 | LocalImageManager.resize(options, function (results) { 23 | // results is the filesystem path of the resized image 24 | console.log(results); 25 | }); 26 | 27 | 28 | 29 | // Remove the resized local image 30 | LocalImageManager.remove(''); 31 | 32 | 33 | 34 | // Download an image and store it locally 35 | var options = { 36 | uri: 'https://www.google.com/images/srpr/logo11w.png', 37 | filename: 'google_logo.png', 38 | }; 39 | 40 | LocalImageManager.download(options, function (results) { 41 | // results is the filesystem path of the downloaded image 42 | console.log(results); 43 | }); 44 | ``` -------------------------------------------------------------------------------- /example/ExampleProject/.flowconfig: -------------------------------------------------------------------------------- 1 | [ignore] 2 | 3 | # We fork some components by platform. 4 | .*/*.web.js 5 | .*/*.android.js 6 | 7 | # Some modules have their own node_modules with overlap 8 | .*/node_modules/node-haste/.* 9 | 10 | # Ignore react-tools where there are overlaps, but don't ignore anything that 11 | # react-native relies on 12 | .*/node_modules/react-tools/src/vendor/core/ExecutionEnvironment.js 13 | .*/node_modules/react-tools/src/browser/eventPlugins/ResponderEventPlugin.js 14 | .*/node_modules/react-tools/src/browser/ui/React.js 15 | .*/node_modules/react-tools/src/core/ReactInstanceHandles.js 16 | .*/node_modules/react-tools/src/event/EventPropagators.js 17 | 18 | # Ignore commoner tests 19 | .*/node_modules/react-tools/node_modules/commoner/test/.* 20 | 21 | # See https://github.com/facebook/flow/issues/442 22 | .*/react-tools/node_modules/commoner/lib/reader.js 23 | 24 | # Ignore jest 25 | .*/react-native/node_modules/jest-cli/.* 26 | 27 | [include] 28 | 29 | [libs] 30 | node_modules/react-native/Libraries/react-native/react-native-interface.js 31 | 32 | [options] 33 | module.system=haste 34 | 35 | [version] 36 | 0.11.0 37 | -------------------------------------------------------------------------------- /example/ExampleProject/.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 | -------------------------------------------------------------------------------- /example/ExampleProject/.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 | 24 | # node.js 25 | # 26 | node_modules/ 27 | npm-debug.log 28 | -------------------------------------------------------------------------------- /example/ExampleProject/ExampleProject.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 008F07F31AC5B25A0029DE68 /* main.jsbundle in Resources */ = {isa = PBXBuildFile; fileRef = 008F07F21AC5B25A0029DE68 /* main.jsbundle */; }; 11 | 00C302E51ABCBA2D00DB3ED1 /* libRCTActionSheet.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */; }; 12 | 00C302E71ABCBA2D00DB3ED1 /* libRCTGeolocation.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */; }; 13 | 00C302E81ABCBA2D00DB3ED1 /* libRCTImage.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302C01ABCB91800DB3ED1 /* libRCTImage.a */; }; 14 | 00C302E91ABCBA2D00DB3ED1 /* libRCTNetwork.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302DC1ABCB9D200DB3ED1 /* libRCTNetwork.a */; }; 15 | 00C302EA1ABCBA2D00DB3ED1 /* libRCTVibration.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302E41ABCB9EE00DB3ED1 /* libRCTVibration.a */; }; 16 | 00E356F31AD99517003FC87E /* ExampleProjectTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* ExampleProjectTests.m */; }; 17 | 133E29F31AD74F7200F7D852 /* libRCTLinking.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 78C398B91ACF4ADC00677621 /* libRCTLinking.a */; }; 18 | 139105C61AF99C1200B5F7CC /* libRCTSettings.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 139105C11AF99BAD00B5F7CC /* libRCTSettings.a */; }; 19 | 139FDEF61B0652A700C62182 /* libRCTWebSocket.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 139FDEF41B06529B00C62182 /* libRCTWebSocket.a */; }; 20 | 13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.m */; }; 21 | 13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB11A68108700A75B9A /* LaunchScreen.xib */; }; 22 | 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; }; 23 | 13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; }; 24 | 146834051AC3E58100842450 /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 146834041AC3E56700842450 /* libReact.a */; }; 25 | 4224FBD91B2A253E004978BB /* RCTLocalImageManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 4224FBD81B2A253E004978BB /* RCTLocalImageManager.m */; }; 26 | 832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 832341B51AAA6A8300B99B32 /* libRCTText.a */; }; 27 | /* End PBXBuildFile section */ 28 | 29 | /* Begin PBXContainerItemProxy section */ 30 | 00C302AB1ABCB8CE00DB3ED1 /* PBXContainerItemProxy */ = { 31 | isa = PBXContainerItemProxy; 32 | containerPortal = 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */; 33 | proxyType = 2; 34 | remoteGlobalIDString = 134814201AA4EA6300B7C361; 35 | remoteInfo = RCTActionSheet; 36 | }; 37 | 00C302B91ABCB90400DB3ED1 /* PBXContainerItemProxy */ = { 38 | isa = PBXContainerItemProxy; 39 | containerPortal = 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */; 40 | proxyType = 2; 41 | remoteGlobalIDString = 134814201AA4EA6300B7C361; 42 | remoteInfo = RCTGeolocation; 43 | }; 44 | 00C302BF1ABCB91800DB3ED1 /* PBXContainerItemProxy */ = { 45 | isa = PBXContainerItemProxy; 46 | containerPortal = 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */; 47 | proxyType = 2; 48 | remoteGlobalIDString = 58B5115D1A9E6B3D00147676; 49 | remoteInfo = RCTImage; 50 | }; 51 | 00C302DB1ABCB9D200DB3ED1 /* PBXContainerItemProxy */ = { 52 | isa = PBXContainerItemProxy; 53 | containerPortal = 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */; 54 | proxyType = 2; 55 | remoteGlobalIDString = 58B511DB1A9E6C8500147676; 56 | remoteInfo = RCTNetwork; 57 | }; 58 | 00C302E31ABCB9EE00DB3ED1 /* PBXContainerItemProxy */ = { 59 | isa = PBXContainerItemProxy; 60 | containerPortal = 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */; 61 | proxyType = 2; 62 | remoteGlobalIDString = 832C81801AAF6DEF007FA2F7; 63 | remoteInfo = RCTVibration; 64 | }; 65 | 00E356F41AD99517003FC87E /* PBXContainerItemProxy */ = { 66 | isa = PBXContainerItemProxy; 67 | containerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */; 68 | proxyType = 1; 69 | remoteGlobalIDString = 13B07F861A680F5B00A75B9A; 70 | remoteInfo = ExampleProject; 71 | }; 72 | 139105C01AF99BAD00B5F7CC /* PBXContainerItemProxy */ = { 73 | isa = PBXContainerItemProxy; 74 | containerPortal = 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */; 75 | proxyType = 2; 76 | remoteGlobalIDString = 134814201AA4EA6300B7C361; 77 | remoteInfo = RCTSettings; 78 | }; 79 | 139FDEF31B06529B00C62182 /* PBXContainerItemProxy */ = { 80 | isa = PBXContainerItemProxy; 81 | containerPortal = 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */; 82 | proxyType = 2; 83 | remoteGlobalIDString = 3C86DF461ADF2C930047B81A; 84 | remoteInfo = RCTWebSocket; 85 | }; 86 | 146834031AC3E56700842450 /* PBXContainerItemProxy */ = { 87 | isa = PBXContainerItemProxy; 88 | containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */; 89 | proxyType = 2; 90 | remoteGlobalIDString = 83CBBA2E1A601D0E00E9B192; 91 | remoteInfo = React; 92 | }; 93 | 78C398B81ACF4ADC00677621 /* PBXContainerItemProxy */ = { 94 | isa = PBXContainerItemProxy; 95 | containerPortal = 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */; 96 | proxyType = 2; 97 | remoteGlobalIDString = 134814201AA4EA6300B7C361; 98 | remoteInfo = RCTLinking; 99 | }; 100 | 832341B41AAA6A8300B99B32 /* PBXContainerItemProxy */ = { 101 | isa = PBXContainerItemProxy; 102 | containerPortal = 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */; 103 | proxyType = 2; 104 | remoteGlobalIDString = 58B5119B1A9E6C1200147676; 105 | remoteInfo = RCTText; 106 | }; 107 | /* End PBXContainerItemProxy section */ 108 | 109 | /* Begin PBXFileReference section */ 110 | 008F07F21AC5B25A0029DE68 /* main.jsbundle */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = main.jsbundle; path = iOS/main.jsbundle; sourceTree = ""; }; 111 | 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTActionSheet.xcodeproj; path = "node_modules/react-native/Libraries/ActionSheetIOS/RCTActionSheet.xcodeproj"; sourceTree = ""; }; 112 | 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTGeolocation.xcodeproj; path = "node_modules/react-native/Libraries/Geolocation/RCTGeolocation.xcodeproj"; sourceTree = ""; }; 113 | 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTImage.xcodeproj; path = "node_modules/react-native/Libraries/Image/RCTImage.xcodeproj"; sourceTree = ""; }; 114 | 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTNetwork.xcodeproj; path = "node_modules/react-native/Libraries/Network/RCTNetwork.xcodeproj"; sourceTree = ""; }; 115 | 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTVibration.xcodeproj; path = "node_modules/react-native/Libraries/Vibration/RCTVibration.xcodeproj"; sourceTree = ""; }; 116 | 00E356EE1AD99517003FC87E /* ExampleProjectTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ExampleProjectTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 117 | 00E356F11AD99517003FC87E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 118 | 00E356F21AD99517003FC87E /* ExampleProjectTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ExampleProjectTests.m; sourceTree = ""; }; 119 | 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTSettings.xcodeproj; path = "node_modules/react-native/Libraries/Settings/RCTSettings.xcodeproj"; sourceTree = ""; }; 120 | 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTWebSocket.xcodeproj; path = "node_modules/react-native/Libraries/WebSocket/RCTWebSocket.xcodeproj"; sourceTree = ""; }; 121 | 13B07F961A680F5B00A75B9A /* ExampleProject.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ExampleProject.app; sourceTree = BUILT_PRODUCTS_DIR; }; 122 | 13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = iOS/AppDelegate.h; sourceTree = ""; }; 123 | 13B07FB01A68108700A75B9A /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AppDelegate.m; path = iOS/AppDelegate.m; sourceTree = ""; }; 124 | 13B07FB21A68108700A75B9A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; 125 | 13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = iOS/Images.xcassets; sourceTree = ""; }; 126 | 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = iOS/Info.plist; sourceTree = ""; }; 127 | 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = iOS/main.m; sourceTree = ""; }; 128 | 146833FF1AC3E56700842450 /* React.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = React.xcodeproj; path = "node_modules/react-native/React/React.xcodeproj"; sourceTree = ""; }; 129 | 4224FBD81B2A253E004978BB /* RCTLocalImageManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = RCTLocalImageManager.m; path = ../../RCTLocalImageManager.m; sourceTree = ""; }; 130 | 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTLinking.xcodeproj; path = "node_modules/react-native/Libraries/LinkingIOS/RCTLinking.xcodeproj"; sourceTree = ""; }; 131 | 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTText.xcodeproj; path = "node_modules/react-native/Libraries/Text/RCTText.xcodeproj"; sourceTree = ""; }; 132 | /* End PBXFileReference section */ 133 | 134 | /* Begin PBXFrameworksBuildPhase section */ 135 | 00E356EB1AD99517003FC87E /* Frameworks */ = { 136 | isa = PBXFrameworksBuildPhase; 137 | buildActionMask = 2147483647; 138 | files = ( 139 | ); 140 | runOnlyForDeploymentPostprocessing = 0; 141 | }; 142 | 13B07F8C1A680F5B00A75B9A /* Frameworks */ = { 143 | isa = PBXFrameworksBuildPhase; 144 | buildActionMask = 2147483647; 145 | files = ( 146 | 146834051AC3E58100842450 /* libReact.a in Frameworks */, 147 | 00C302E51ABCBA2D00DB3ED1 /* libRCTActionSheet.a in Frameworks */, 148 | 00C302E71ABCBA2D00DB3ED1 /* libRCTGeolocation.a in Frameworks */, 149 | 00C302E81ABCBA2D00DB3ED1 /* libRCTImage.a in Frameworks */, 150 | 133E29F31AD74F7200F7D852 /* libRCTLinking.a in Frameworks */, 151 | 00C302E91ABCBA2D00DB3ED1 /* libRCTNetwork.a in Frameworks */, 152 | 139105C61AF99C1200B5F7CC /* libRCTSettings.a in Frameworks */, 153 | 832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */, 154 | 00C302EA1ABCBA2D00DB3ED1 /* libRCTVibration.a in Frameworks */, 155 | 139FDEF61B0652A700C62182 /* libRCTWebSocket.a in Frameworks */, 156 | ); 157 | runOnlyForDeploymentPostprocessing = 0; 158 | }; 159 | /* End PBXFrameworksBuildPhase section */ 160 | 161 | /* Begin PBXGroup section */ 162 | 00C302A81ABCB8CE00DB3ED1 /* Products */ = { 163 | isa = PBXGroup; 164 | children = ( 165 | 00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */, 166 | ); 167 | name = Products; 168 | sourceTree = ""; 169 | }; 170 | 00C302B61ABCB90400DB3ED1 /* Products */ = { 171 | isa = PBXGroup; 172 | children = ( 173 | 00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */, 174 | ); 175 | name = Products; 176 | sourceTree = ""; 177 | }; 178 | 00C302BC1ABCB91800DB3ED1 /* Products */ = { 179 | isa = PBXGroup; 180 | children = ( 181 | 00C302C01ABCB91800DB3ED1 /* libRCTImage.a */, 182 | ); 183 | name = Products; 184 | sourceTree = ""; 185 | }; 186 | 00C302D41ABCB9D200DB3ED1 /* Products */ = { 187 | isa = PBXGroup; 188 | children = ( 189 | 00C302DC1ABCB9D200DB3ED1 /* libRCTNetwork.a */, 190 | ); 191 | name = Products; 192 | sourceTree = ""; 193 | }; 194 | 00C302E01ABCB9EE00DB3ED1 /* Products */ = { 195 | isa = PBXGroup; 196 | children = ( 197 | 00C302E41ABCB9EE00DB3ED1 /* libRCTVibration.a */, 198 | ); 199 | name = Products; 200 | sourceTree = ""; 201 | }; 202 | 00E356EF1AD99517003FC87E /* ExampleProjectTests */ = { 203 | isa = PBXGroup; 204 | children = ( 205 | 00E356F21AD99517003FC87E /* ExampleProjectTests.m */, 206 | 00E356F01AD99517003FC87E /* Supporting Files */, 207 | ); 208 | path = ExampleProjectTests; 209 | sourceTree = ""; 210 | }; 211 | 00E356F01AD99517003FC87E /* Supporting Files */ = { 212 | isa = PBXGroup; 213 | children = ( 214 | 00E356F11AD99517003FC87E /* Info.plist */, 215 | ); 216 | name = "Supporting Files"; 217 | sourceTree = ""; 218 | }; 219 | 139105B71AF99BAD00B5F7CC /* Products */ = { 220 | isa = PBXGroup; 221 | children = ( 222 | 139105C11AF99BAD00B5F7CC /* libRCTSettings.a */, 223 | ); 224 | name = Products; 225 | sourceTree = ""; 226 | }; 227 | 139FDEE71B06529A00C62182 /* Products */ = { 228 | isa = PBXGroup; 229 | children = ( 230 | 139FDEF41B06529B00C62182 /* libRCTWebSocket.a */, 231 | ); 232 | name = Products; 233 | sourceTree = ""; 234 | }; 235 | 13B07FAE1A68108700A75B9A /* ExampleProject */ = { 236 | isa = PBXGroup; 237 | children = ( 238 | 4224FBD81B2A253E004978BB /* RCTLocalImageManager.m */, 239 | 008F07F21AC5B25A0029DE68 /* main.jsbundle */, 240 | 13B07FAF1A68108700A75B9A /* AppDelegate.h */, 241 | 13B07FB01A68108700A75B9A /* AppDelegate.m */, 242 | 13B07FB51A68108700A75B9A /* Images.xcassets */, 243 | 13B07FB61A68108700A75B9A /* Info.plist */, 244 | 13B07FB11A68108700A75B9A /* LaunchScreen.xib */, 245 | 13B07FB71A68108700A75B9A /* main.m */, 246 | ); 247 | name = ExampleProject; 248 | sourceTree = ""; 249 | }; 250 | 146834001AC3E56700842450 /* Products */ = { 251 | isa = PBXGroup; 252 | children = ( 253 | 146834041AC3E56700842450 /* libReact.a */, 254 | ); 255 | name = Products; 256 | sourceTree = ""; 257 | }; 258 | 78C398B11ACF4ADC00677621 /* Products */ = { 259 | isa = PBXGroup; 260 | children = ( 261 | 78C398B91ACF4ADC00677621 /* libRCTLinking.a */, 262 | ); 263 | name = Products; 264 | sourceTree = ""; 265 | }; 266 | 832341AE1AAA6A7D00B99B32 /* Libraries */ = { 267 | isa = PBXGroup; 268 | children = ( 269 | 146833FF1AC3E56700842450 /* React.xcodeproj */, 270 | 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */, 271 | 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */, 272 | 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */, 273 | 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */, 274 | 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */, 275 | 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */, 276 | 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */, 277 | 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */, 278 | 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */, 279 | ); 280 | name = Libraries; 281 | sourceTree = ""; 282 | }; 283 | 832341B11AAA6A8300B99B32 /* Products */ = { 284 | isa = PBXGroup; 285 | children = ( 286 | 832341B51AAA6A8300B99B32 /* libRCTText.a */, 287 | ); 288 | name = Products; 289 | sourceTree = ""; 290 | }; 291 | 83CBB9F61A601CBA00E9B192 = { 292 | isa = PBXGroup; 293 | children = ( 294 | 13B07FAE1A68108700A75B9A /* ExampleProject */, 295 | 832341AE1AAA6A7D00B99B32 /* Libraries */, 296 | 00E356EF1AD99517003FC87E /* ExampleProjectTests */, 297 | 83CBBA001A601CBA00E9B192 /* Products */, 298 | ); 299 | indentWidth = 2; 300 | sourceTree = ""; 301 | tabWidth = 2; 302 | }; 303 | 83CBBA001A601CBA00E9B192 /* Products */ = { 304 | isa = PBXGroup; 305 | children = ( 306 | 13B07F961A680F5B00A75B9A /* ExampleProject.app */, 307 | 00E356EE1AD99517003FC87E /* ExampleProjectTests.xctest */, 308 | ); 309 | name = Products; 310 | sourceTree = ""; 311 | }; 312 | /* End PBXGroup section */ 313 | 314 | /* Begin PBXNativeTarget section */ 315 | 00E356ED1AD99517003FC87E /* ExampleProjectTests */ = { 316 | isa = PBXNativeTarget; 317 | buildConfigurationList = 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "ExampleProjectTests" */; 318 | buildPhases = ( 319 | 00E356EA1AD99517003FC87E /* Sources */, 320 | 00E356EB1AD99517003FC87E /* Frameworks */, 321 | 00E356EC1AD99517003FC87E /* Resources */, 322 | ); 323 | buildRules = ( 324 | ); 325 | dependencies = ( 326 | 00E356F51AD99517003FC87E /* PBXTargetDependency */, 327 | ); 328 | name = ExampleProjectTests; 329 | productName = ExampleProjectTests; 330 | productReference = 00E356EE1AD99517003FC87E /* ExampleProjectTests.xctest */; 331 | productType = "com.apple.product-type.bundle.unit-test"; 332 | }; 333 | 13B07F861A680F5B00A75B9A /* ExampleProject */ = { 334 | isa = PBXNativeTarget; 335 | buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "ExampleProject" */; 336 | buildPhases = ( 337 | 13B07F871A680F5B00A75B9A /* Sources */, 338 | 13B07F8C1A680F5B00A75B9A /* Frameworks */, 339 | 13B07F8E1A680F5B00A75B9A /* Resources */, 340 | ); 341 | buildRules = ( 342 | ); 343 | dependencies = ( 344 | ); 345 | name = ExampleProject; 346 | productName = "Hello World"; 347 | productReference = 13B07F961A680F5B00A75B9A /* ExampleProject.app */; 348 | productType = "com.apple.product-type.application"; 349 | }; 350 | /* End PBXNativeTarget section */ 351 | 352 | /* Begin PBXProject section */ 353 | 83CBB9F71A601CBA00E9B192 /* Project object */ = { 354 | isa = PBXProject; 355 | attributes = { 356 | LastUpgradeCheck = 0610; 357 | ORGANIZATIONNAME = Facebook; 358 | TargetAttributes = { 359 | 00E356ED1AD99517003FC87E = { 360 | CreatedOnToolsVersion = 6.2; 361 | TestTargetID = 13B07F861A680F5B00A75B9A; 362 | }; 363 | }; 364 | }; 365 | buildConfigurationList = 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "ExampleProject" */; 366 | compatibilityVersion = "Xcode 3.2"; 367 | developmentRegion = English; 368 | hasScannedForEncodings = 0; 369 | knownRegions = ( 370 | en, 371 | Base, 372 | ); 373 | mainGroup = 83CBB9F61A601CBA00E9B192; 374 | productRefGroup = 83CBBA001A601CBA00E9B192 /* Products */; 375 | projectDirPath = ""; 376 | projectReferences = ( 377 | { 378 | ProductGroup = 00C302A81ABCB8CE00DB3ED1 /* Products */; 379 | ProjectRef = 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */; 380 | }, 381 | { 382 | ProductGroup = 00C302B61ABCB90400DB3ED1 /* Products */; 383 | ProjectRef = 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */; 384 | }, 385 | { 386 | ProductGroup = 00C302BC1ABCB91800DB3ED1 /* Products */; 387 | ProjectRef = 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */; 388 | }, 389 | { 390 | ProductGroup = 78C398B11ACF4ADC00677621 /* Products */; 391 | ProjectRef = 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */; 392 | }, 393 | { 394 | ProductGroup = 00C302D41ABCB9D200DB3ED1 /* Products */; 395 | ProjectRef = 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */; 396 | }, 397 | { 398 | ProductGroup = 139105B71AF99BAD00B5F7CC /* Products */; 399 | ProjectRef = 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */; 400 | }, 401 | { 402 | ProductGroup = 832341B11AAA6A8300B99B32 /* Products */; 403 | ProjectRef = 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */; 404 | }, 405 | { 406 | ProductGroup = 00C302E01ABCB9EE00DB3ED1 /* Products */; 407 | ProjectRef = 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */; 408 | }, 409 | { 410 | ProductGroup = 139FDEE71B06529A00C62182 /* Products */; 411 | ProjectRef = 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */; 412 | }, 413 | { 414 | ProductGroup = 146834001AC3E56700842450 /* Products */; 415 | ProjectRef = 146833FF1AC3E56700842450 /* React.xcodeproj */; 416 | }, 417 | ); 418 | projectRoot = ""; 419 | targets = ( 420 | 13B07F861A680F5B00A75B9A /* ExampleProject */, 421 | 00E356ED1AD99517003FC87E /* ExampleProjectTests */, 422 | ); 423 | }; 424 | /* End PBXProject section */ 425 | 426 | /* Begin PBXReferenceProxy section */ 427 | 00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */ = { 428 | isa = PBXReferenceProxy; 429 | fileType = archive.ar; 430 | path = libRCTActionSheet.a; 431 | remoteRef = 00C302AB1ABCB8CE00DB3ED1 /* PBXContainerItemProxy */; 432 | sourceTree = BUILT_PRODUCTS_DIR; 433 | }; 434 | 00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */ = { 435 | isa = PBXReferenceProxy; 436 | fileType = archive.ar; 437 | path = libRCTGeolocation.a; 438 | remoteRef = 00C302B91ABCB90400DB3ED1 /* PBXContainerItemProxy */; 439 | sourceTree = BUILT_PRODUCTS_DIR; 440 | }; 441 | 00C302C01ABCB91800DB3ED1 /* libRCTImage.a */ = { 442 | isa = PBXReferenceProxy; 443 | fileType = archive.ar; 444 | path = libRCTImage.a; 445 | remoteRef = 00C302BF1ABCB91800DB3ED1 /* PBXContainerItemProxy */; 446 | sourceTree = BUILT_PRODUCTS_DIR; 447 | }; 448 | 00C302DC1ABCB9D200DB3ED1 /* libRCTNetwork.a */ = { 449 | isa = PBXReferenceProxy; 450 | fileType = archive.ar; 451 | path = libRCTNetwork.a; 452 | remoteRef = 00C302DB1ABCB9D200DB3ED1 /* PBXContainerItemProxy */; 453 | sourceTree = BUILT_PRODUCTS_DIR; 454 | }; 455 | 00C302E41ABCB9EE00DB3ED1 /* libRCTVibration.a */ = { 456 | isa = PBXReferenceProxy; 457 | fileType = archive.ar; 458 | path = libRCTVibration.a; 459 | remoteRef = 00C302E31ABCB9EE00DB3ED1 /* PBXContainerItemProxy */; 460 | sourceTree = BUILT_PRODUCTS_DIR; 461 | }; 462 | 139105C11AF99BAD00B5F7CC /* libRCTSettings.a */ = { 463 | isa = PBXReferenceProxy; 464 | fileType = archive.ar; 465 | path = libRCTSettings.a; 466 | remoteRef = 139105C01AF99BAD00B5F7CC /* PBXContainerItemProxy */; 467 | sourceTree = BUILT_PRODUCTS_DIR; 468 | }; 469 | 139FDEF41B06529B00C62182 /* libRCTWebSocket.a */ = { 470 | isa = PBXReferenceProxy; 471 | fileType = archive.ar; 472 | path = libRCTWebSocket.a; 473 | remoteRef = 139FDEF31B06529B00C62182 /* PBXContainerItemProxy */; 474 | sourceTree = BUILT_PRODUCTS_DIR; 475 | }; 476 | 146834041AC3E56700842450 /* libReact.a */ = { 477 | isa = PBXReferenceProxy; 478 | fileType = archive.ar; 479 | path = libReact.a; 480 | remoteRef = 146834031AC3E56700842450 /* PBXContainerItemProxy */; 481 | sourceTree = BUILT_PRODUCTS_DIR; 482 | }; 483 | 78C398B91ACF4ADC00677621 /* libRCTLinking.a */ = { 484 | isa = PBXReferenceProxy; 485 | fileType = archive.ar; 486 | path = libRCTLinking.a; 487 | remoteRef = 78C398B81ACF4ADC00677621 /* PBXContainerItemProxy */; 488 | sourceTree = BUILT_PRODUCTS_DIR; 489 | }; 490 | 832341B51AAA6A8300B99B32 /* libRCTText.a */ = { 491 | isa = PBXReferenceProxy; 492 | fileType = archive.ar; 493 | path = libRCTText.a; 494 | remoteRef = 832341B41AAA6A8300B99B32 /* PBXContainerItemProxy */; 495 | sourceTree = BUILT_PRODUCTS_DIR; 496 | }; 497 | /* End PBXReferenceProxy section */ 498 | 499 | /* Begin PBXResourcesBuildPhase section */ 500 | 00E356EC1AD99517003FC87E /* Resources */ = { 501 | isa = PBXResourcesBuildPhase; 502 | buildActionMask = 2147483647; 503 | files = ( 504 | ); 505 | runOnlyForDeploymentPostprocessing = 0; 506 | }; 507 | 13B07F8E1A680F5B00A75B9A /* Resources */ = { 508 | isa = PBXResourcesBuildPhase; 509 | buildActionMask = 2147483647; 510 | files = ( 511 | 008F07F31AC5B25A0029DE68 /* main.jsbundle in Resources */, 512 | 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */, 513 | 13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */, 514 | ); 515 | runOnlyForDeploymentPostprocessing = 0; 516 | }; 517 | /* End PBXResourcesBuildPhase section */ 518 | 519 | /* Begin PBXSourcesBuildPhase section */ 520 | 00E356EA1AD99517003FC87E /* Sources */ = { 521 | isa = PBXSourcesBuildPhase; 522 | buildActionMask = 2147483647; 523 | files = ( 524 | 00E356F31AD99517003FC87E /* ExampleProjectTests.m in Sources */, 525 | ); 526 | runOnlyForDeploymentPostprocessing = 0; 527 | }; 528 | 13B07F871A680F5B00A75B9A /* Sources */ = { 529 | isa = PBXSourcesBuildPhase; 530 | buildActionMask = 2147483647; 531 | files = ( 532 | 4224FBD91B2A253E004978BB /* RCTLocalImageManager.m in Sources */, 533 | 13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */, 534 | 13B07FC11A68108700A75B9A /* main.m in Sources */, 535 | ); 536 | runOnlyForDeploymentPostprocessing = 0; 537 | }; 538 | /* End PBXSourcesBuildPhase section */ 539 | 540 | /* Begin PBXTargetDependency section */ 541 | 00E356F51AD99517003FC87E /* PBXTargetDependency */ = { 542 | isa = PBXTargetDependency; 543 | target = 13B07F861A680F5B00A75B9A /* ExampleProject */; 544 | targetProxy = 00E356F41AD99517003FC87E /* PBXContainerItemProxy */; 545 | }; 546 | /* End PBXTargetDependency section */ 547 | 548 | /* Begin PBXVariantGroup section */ 549 | 13B07FB11A68108700A75B9A /* LaunchScreen.xib */ = { 550 | isa = PBXVariantGroup; 551 | children = ( 552 | 13B07FB21A68108700A75B9A /* Base */, 553 | ); 554 | name = LaunchScreen.xib; 555 | path = iOS; 556 | sourceTree = ""; 557 | }; 558 | /* End PBXVariantGroup section */ 559 | 560 | /* Begin XCBuildConfiguration section */ 561 | 00E356F61AD99517003FC87E /* Debug */ = { 562 | isa = XCBuildConfiguration; 563 | buildSettings = { 564 | BUNDLE_LOADER = "$(TEST_HOST)"; 565 | FRAMEWORK_SEARCH_PATHS = ( 566 | "$(SDKROOT)/Developer/Library/Frameworks", 567 | "$(inherited)", 568 | ); 569 | GCC_PREPROCESSOR_DEFINITIONS = ( 570 | "DEBUG=1", 571 | "$(inherited)", 572 | ); 573 | INFOPLIST_FILE = ExampleProjectTests/Info.plist; 574 | IPHONEOS_DEPLOYMENT_TARGET = 8.2; 575 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 576 | PRODUCT_NAME = "$(TARGET_NAME)"; 577 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ExampleProject.app/ExampleProject"; 578 | }; 579 | name = Debug; 580 | }; 581 | 00E356F71AD99517003FC87E /* Release */ = { 582 | isa = XCBuildConfiguration; 583 | buildSettings = { 584 | BUNDLE_LOADER = "$(TEST_HOST)"; 585 | COPY_PHASE_STRIP = NO; 586 | FRAMEWORK_SEARCH_PATHS = ( 587 | "$(SDKROOT)/Developer/Library/Frameworks", 588 | "$(inherited)", 589 | ); 590 | INFOPLIST_FILE = ExampleProjectTests/Info.plist; 591 | IPHONEOS_DEPLOYMENT_TARGET = 8.2; 592 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 593 | PRODUCT_NAME = "$(TARGET_NAME)"; 594 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ExampleProject.app/ExampleProject"; 595 | }; 596 | name = Release; 597 | }; 598 | 13B07F941A680F5B00A75B9A /* Debug */ = { 599 | isa = XCBuildConfiguration; 600 | buildSettings = { 601 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 602 | HEADER_SEARCH_PATHS = ( 603 | "$(inherited)", 604 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, 605 | "$(SRCROOT)/node_modules/react-native/React/**", 606 | ); 607 | INFOPLIST_FILE = "$(SRCROOT)/iOS/Info.plist"; 608 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 609 | OTHER_LDFLAGS = "-ObjC"; 610 | PRODUCT_NAME = ExampleProject; 611 | }; 612 | name = Debug; 613 | }; 614 | 13B07F951A680F5B00A75B9A /* Release */ = { 615 | isa = XCBuildConfiguration; 616 | buildSettings = { 617 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 618 | HEADER_SEARCH_PATHS = ( 619 | "$(inherited)", 620 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, 621 | "$(SRCROOT)/node_modules/react-native/React/**", 622 | ); 623 | INFOPLIST_FILE = "$(SRCROOT)/iOS/Info.plist"; 624 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 625 | OTHER_LDFLAGS = "-ObjC"; 626 | PRODUCT_NAME = ExampleProject; 627 | }; 628 | name = Release; 629 | }; 630 | 83CBBA201A601CBA00E9B192 /* Debug */ = { 631 | isa = XCBuildConfiguration; 632 | buildSettings = { 633 | ALWAYS_SEARCH_USER_PATHS = NO; 634 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 635 | CLANG_CXX_LIBRARY = "libc++"; 636 | CLANG_ENABLE_MODULES = YES; 637 | CLANG_ENABLE_OBJC_ARC = YES; 638 | CLANG_WARN_BOOL_CONVERSION = YES; 639 | CLANG_WARN_CONSTANT_CONVERSION = YES; 640 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 641 | CLANG_WARN_EMPTY_BODY = YES; 642 | CLANG_WARN_ENUM_CONVERSION = YES; 643 | CLANG_WARN_INT_CONVERSION = YES; 644 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 645 | CLANG_WARN_UNREACHABLE_CODE = YES; 646 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 647 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 648 | COPY_PHASE_STRIP = NO; 649 | ENABLE_STRICT_OBJC_MSGSEND = YES; 650 | GCC_C_LANGUAGE_STANDARD = gnu99; 651 | GCC_DYNAMIC_NO_PIC = NO; 652 | GCC_OPTIMIZATION_LEVEL = 0; 653 | GCC_PREPROCESSOR_DEFINITIONS = ( 654 | "DEBUG=1", 655 | "$(inherited)", 656 | ); 657 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 658 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 659 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 660 | GCC_WARN_UNDECLARED_SELECTOR = YES; 661 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 662 | GCC_WARN_UNUSED_FUNCTION = YES; 663 | GCC_WARN_UNUSED_VARIABLE = YES; 664 | HEADER_SEARCH_PATHS = ( 665 | "$(inherited)", 666 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, 667 | "$(SRCROOT)/node_modules/react-native/React/**", 668 | ); 669 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 670 | MTL_ENABLE_DEBUG_INFO = YES; 671 | ONLY_ACTIVE_ARCH = YES; 672 | SDKROOT = iphoneos; 673 | }; 674 | name = Debug; 675 | }; 676 | 83CBBA211A601CBA00E9B192 /* Release */ = { 677 | isa = XCBuildConfiguration; 678 | buildSettings = { 679 | ALWAYS_SEARCH_USER_PATHS = NO; 680 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 681 | CLANG_CXX_LIBRARY = "libc++"; 682 | CLANG_ENABLE_MODULES = YES; 683 | CLANG_ENABLE_OBJC_ARC = YES; 684 | CLANG_WARN_BOOL_CONVERSION = YES; 685 | CLANG_WARN_CONSTANT_CONVERSION = YES; 686 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 687 | CLANG_WARN_EMPTY_BODY = YES; 688 | CLANG_WARN_ENUM_CONVERSION = YES; 689 | CLANG_WARN_INT_CONVERSION = YES; 690 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 691 | CLANG_WARN_UNREACHABLE_CODE = YES; 692 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 693 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 694 | COPY_PHASE_STRIP = YES; 695 | ENABLE_NS_ASSERTIONS = NO; 696 | ENABLE_STRICT_OBJC_MSGSEND = YES; 697 | GCC_C_LANGUAGE_STANDARD = gnu99; 698 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 699 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 700 | GCC_WARN_UNDECLARED_SELECTOR = YES; 701 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 702 | GCC_WARN_UNUSED_FUNCTION = YES; 703 | GCC_WARN_UNUSED_VARIABLE = YES; 704 | HEADER_SEARCH_PATHS = ( 705 | "$(inherited)", 706 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, 707 | "$(SRCROOT)/node_modules/react-native/React/**", 708 | ); 709 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 710 | MTL_ENABLE_DEBUG_INFO = NO; 711 | SDKROOT = iphoneos; 712 | VALIDATE_PRODUCT = YES; 713 | }; 714 | name = Release; 715 | }; 716 | /* End XCBuildConfiguration section */ 717 | 718 | /* Begin XCConfigurationList section */ 719 | 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "ExampleProjectTests" */ = { 720 | isa = XCConfigurationList; 721 | buildConfigurations = ( 722 | 00E356F61AD99517003FC87E /* Debug */, 723 | 00E356F71AD99517003FC87E /* Release */, 724 | ); 725 | defaultConfigurationIsVisible = 0; 726 | defaultConfigurationName = Release; 727 | }; 728 | 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "ExampleProject" */ = { 729 | isa = XCConfigurationList; 730 | buildConfigurations = ( 731 | 13B07F941A680F5B00A75B9A /* Debug */, 732 | 13B07F951A680F5B00A75B9A /* Release */, 733 | ); 734 | defaultConfigurationIsVisible = 0; 735 | defaultConfigurationName = Release; 736 | }; 737 | 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "ExampleProject" */ = { 738 | isa = XCConfigurationList; 739 | buildConfigurations = ( 740 | 83CBBA201A601CBA00E9B192 /* Debug */, 741 | 83CBBA211A601CBA00E9B192 /* Release */, 742 | ); 743 | defaultConfigurationIsVisible = 0; 744 | defaultConfigurationName = Release; 745 | }; 746 | /* End XCConfigurationList section */ 747 | }; 748 | rootObject = 83CBB9F71A601CBA00E9B192 /* Project object */; 749 | } 750 | -------------------------------------------------------------------------------- /example/ExampleProject/ExampleProject.xcodeproj/xcshareddata/xcschemes/ExampleProject.xcscheme: -------------------------------------------------------------------------------- 1 | 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 | 77 | 83 | 84 | 85 | 86 | 87 | 88 | 94 | 96 | 102 | 103 | 104 | 105 | 107 | 108 | 111 | 112 | 113 | -------------------------------------------------------------------------------- /example/ExampleProject/ExampleProjectTests/ExampleProjectTests.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | #import 12 | 13 | #import "RCTAssert.h" 14 | #import "RCTRedBox.h" 15 | #import "RCTRootView.h" 16 | 17 | #define TIMEOUT_SECONDS 240 18 | #define TEXT_TO_LOOK_FOR @"Welcome to React Native!" 19 | 20 | @interface ExampleProjectTests : XCTestCase 21 | 22 | @end 23 | 24 | @implementation ExampleProjectTests 25 | 26 | 27 | - (BOOL)findSubviewInView:(UIView *)view matching:(BOOL(^)(UIView *view))test 28 | { 29 | if (test(view)) { 30 | return YES; 31 | } 32 | for (UIView *subview in [view subviews]) { 33 | if ([self findSubviewInView:subview matching:test]) { 34 | return YES; 35 | } 36 | } 37 | return NO; 38 | } 39 | 40 | - (void)testRendersWelcomeScreen { 41 | UIViewController *vc = [[[[UIApplication sharedApplication] delegate] window] rootViewController]; 42 | NSDate *date = [NSDate dateWithTimeIntervalSinceNow:TIMEOUT_SECONDS]; 43 | BOOL foundElement = NO; 44 | NSString *redboxError = nil; 45 | 46 | while ([date timeIntervalSinceNow] > 0 && !foundElement && !redboxError) { 47 | [[NSRunLoop mainRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]; 48 | [[NSRunLoop mainRunLoop] runMode:NSRunLoopCommonModes beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]; 49 | 50 | redboxError = [[RCTRedBox sharedInstance] currentErrorMessage]; 51 | 52 | foundElement = [self findSubviewInView:vc.view matching:^BOOL(UIView *view) { 53 | if ([view respondsToSelector:@selector(attributedText)]) { 54 | NSString *text = [(id)view attributedText].string; 55 | if ([text isEqualToString:TEXT_TO_LOOK_FOR]) { 56 | return YES; 57 | } 58 | } 59 | return NO; 60 | }]; 61 | } 62 | 63 | XCTAssertNil(redboxError, @"RedBox error: %@", redboxError); 64 | XCTAssertTrue(foundElement, @"Cound't find element with text '%@' in %d seconds", TEXT_TO_LOOK_FOR, TIMEOUT_SECONDS); 65 | } 66 | 67 | 68 | @end 69 | -------------------------------------------------------------------------------- /example/ExampleProject/ExampleProjectTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /example/ExampleProject/iOS/AppDelegate.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | @interface AppDelegate : UIResponder 13 | 14 | @property (nonatomic, strong) UIWindow *window; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /example/ExampleProject/iOS/AppDelegate.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import "AppDelegate.h" 11 | 12 | #import "RCTRootView.h" 13 | 14 | @implementation AppDelegate 15 | 16 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 17 | { 18 | NSURL *jsCodeLocation; 19 | 20 | /** 21 | * Loading JavaScript code - uncomment the one you want. 22 | * 23 | * OPTION 1 24 | * Load from development server. Start the server from the repository root: 25 | * 26 | * $ npm start 27 | * 28 | * To run on device, change `localhost` to the IP address of your computer 29 | * (you can get this by typing `ifconfig` into the terminal and selecting the 30 | * `inet` value under `en0:`) and make sure your computer and iOS device are 31 | * on the same Wi-Fi network. 32 | */ 33 | 34 | jsCodeLocation = [NSURL URLWithString:@"http://localhost:8081/index.ios.bundle"]; 35 | 36 | /** 37 | * OPTION 2 38 | * Load from pre-bundled file on disk. To re-generate the static bundle 39 | * from the root of your project directory, run 40 | * 41 | * $ react-native bundle --minify 42 | * 43 | * see http://facebook.github.io/react-native/docs/runningondevice.html 44 | */ 45 | 46 | // jsCodeLocation = [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"]; 47 | 48 | RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation 49 | moduleName:@"ExampleProject" 50 | launchOptions:launchOptions]; 51 | 52 | self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; 53 | UIViewController *rootViewController = [[UIViewController alloc] init]; 54 | rootViewController.view = rootView; 55 | self.window.rootViewController = rootViewController; 56 | [self.window makeKeyAndVisible]; 57 | return YES; 58 | } 59 | 60 | @end 61 | -------------------------------------------------------------------------------- /example/ExampleProject/iOS/Base.lproj/LaunchScreen.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 21 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /example/ExampleProject/iOS/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | } 33 | ], 34 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } -------------------------------------------------------------------------------- /example/ExampleProject/iOS/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UIViewControllerBasedStatusBarAppearance 38 | 39 | NSLocationWhenInUseUsageDescription 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /example/ExampleProject/iOS/main.jsbundle: -------------------------------------------------------------------------------- 1 | // Offline JS 2 | // To re-generate the offline bundle, run this from the root of your project: 3 | // 4 | // $ react-native bundle --minify 5 | // 6 | // See http://facebook.github.io/react-native/docs/runningondevice.html for more details. 7 | 8 | throw new Error('Offline JS file is empty. See iOS/main.jsbundle for instructions'); 9 | -------------------------------------------------------------------------------- /example/ExampleProject/iOS/main.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | #import "AppDelegate.h" 13 | 14 | int main(int argc, char * argv[]) { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /example/ExampleProject/index.ios.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Sample React Native App 3 | * https://github.com/facebook/react-native 4 | */ 5 | 'use strict'; 6 | 7 | var React = require('react-native'); 8 | var { 9 | AppRegistry, 10 | StyleSheet, 11 | Text, 12 | Image, 13 | View, 14 | TouchableOpacity, 15 | CameraRoll, 16 | } = React; 17 | var logError = require('logError'); 18 | 19 | var LocalImageManager = require('NativeModules').LocalImageManager; 20 | 21 | var ExampleProject = React.createClass({ 22 | 23 | getInitialState: function() { 24 | return { 25 | imageResult: null, 26 | resizeResult: null, 27 | }; 28 | }, 29 | 30 | render: function() { 31 | var imageElement; 32 | var resizeElement; 33 | 34 | if (this.state.imageResult) { 35 | imageElement = ( 36 | 37 | ); 38 | } 39 | 40 | if (this.state.resizeResult) { 41 | resizeElement = ( 42 | 43 | ); 44 | } 45 | return ( 46 | 47 | 48 | 49 | Download Image 50 | 51 | 52 | {imageElement} 53 | 54 | 55 | 56 | Resize Camera Roll Image 57 | 58 | 59 | {resizeElement} 60 | 61 | ); 62 | }, 63 | 64 | downloadImage () { 65 | var options = { 66 | uri: 'https://igcdn-photos-a-a.akamaihd.net/hphotos-ak-xfa1/t51.2885-15/11242865_1062704387091208_1538328286_n.jpg', 67 | filename: 'pup.jpg', 68 | }; 69 | 70 | LocalImageManager.download(options, (results) => { 71 | // results is the filesystem path of the downloaded image 72 | console.log(results); 73 | this.setState({ imageResult: results }); 74 | }); 75 | }, 76 | 77 | resizeImage () { 78 | // grab the first camera roll image 79 | CameraRoll.getPhotos({ first: 1 }, (path) => { 80 | var image = path.edges[0].node.image.uri; 81 | 82 | var options = { 83 | uri: image, 84 | width: 200, 85 | height: 200, 86 | quality: 0.5, 87 | filename: 'small.jpg', 88 | }; 89 | 90 | // resize the image 91 | LocalImageManager.resize(options, (results)=>{ 92 | // results is the filesystem path of the resized image 93 | console.log(results); 94 | this.setState({ resizeResult: results }); 95 | }); 96 | 97 | }, logError); 98 | } 99 | }); 100 | 101 | var styles = StyleSheet.create({ 102 | container: { 103 | flex: 1, 104 | justifyContent: 'center', 105 | alignItems: 'center', 106 | backgroundColor: '#F5FCFF', 107 | }, 108 | welcome: { 109 | fontSize: 20, 110 | textAlign: 'center', 111 | margin: 10, 112 | }, 113 | image: { 114 | width: 200, 115 | height: 200, 116 | }, 117 | }); 118 | 119 | AppRegistry.registerComponent('ExampleProject', () => ExampleProject); 120 | -------------------------------------------------------------------------------- /example/ExampleProject/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ExampleProject", 3 | "version": "0.0.1", 4 | "private": true, 5 | "scripts": { 6 | "start": "node_modules/react-native/packager/packager.sh" 7 | }, 8 | "dependencies": { 9 | "react-native": "^0.5.0" 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "react-native-local-image-manager", 3 | "version": "1.0.1", 4 | "description": "A React Native module for downloading and resizing local images.", 5 | "scripts": { 6 | "test": "echo \"Error: no test specified\" && exit 1" 7 | }, 8 | "repository": { 9 | "type": "git", 10 | "url": "https://github.com/asamiller/react-native-local-image-manager.git" 11 | }, 12 | "author": "Asa Miller", 13 | "license": "MIT", 14 | "bugs": { 15 | "url": "https://github.com/asamiller/react-native-local-image-manager/issues" 16 | }, 17 | "homepage": "https://github.com/asamiller/react-native-local-image-manager" 18 | } 19 | --------------------------------------------------------------------------------