├── .npmignore ├── LICENSE ├── README.md ├── android ├── build.gradle └── src │ └── main │ ├── AndroidManifest.xml │ └── java │ └── fr │ └── bamlab │ └── rncameraroll │ ├── CameraImage.java │ ├── CameraImagesManager.java │ ├── CameraRollModule.java │ └── CameraRollPackage.java ├── example ├── .flowconfig ├── .gitignore ├── .watchmanconfig ├── CameraRollGallery.js ├── android │ ├── app │ │ ├── build.gradle │ │ ├── proguard-rules.pro │ │ ├── react.gradle │ │ └── src │ │ │ └── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── java │ │ │ └── com │ │ │ │ └── example │ │ │ │ └── MainActivity.java │ │ │ └── res │ │ │ ├── mipmap-hdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-mdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xhdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxhdpi │ │ │ └── ic_launcher.png │ │ │ └── values │ │ │ ├── strings.xml │ │ │ └── styles.xml │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ └── settings.gradle ├── index.android.js ├── index.ios.js ├── ios │ ├── example.xcodeproj │ │ ├── project.pbxproj │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ └── example.xcscheme │ ├── example │ │ ├── AppDelegate.h │ │ ├── AppDelegate.m │ │ ├── Base.lproj │ │ │ └── LaunchScreen.xib │ │ ├── Images.xcassets │ │ │ └── AppIcon.appiconset │ │ │ │ └── Contents.json │ │ ├── Info.plist │ │ └── main.m │ └── exampleTests │ │ ├── Info.plist │ │ └── exampleTests.m ├── package.json └── screenshot.png ├── index.android.js ├── index.ios.js └── package.json /.npmignore: -------------------------------------------------------------------------------- 1 | example 2 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Alexandre Moureaux 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 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # React Native Camera Roll 2 | 3 | **UPDATE:** 4 | ### As of react-native `0.19`, the [`CameraRoll` API](https://facebook.github.io/react-native/docs/cameraroll.html#content) is now available on Android too! You should not use this module anymore and only use the `CameraRoll` API from React Native. 5 | 6 | ## Table of contents 7 | 8 | * [Example](https://github.com/bamlab/rn-camera-roll#example) 9 | * [Setup](https://github.com/bamlab/rn-camera-roll#setup) 10 | * [Usage](https://github.com/bamlab/rn-camera-roll#usage) 11 | 12 | ## Example 13 | 14 | Checkout [this example](https://github.com/bamlab/rn-camera-roll/tree/master/example) of a basic gallery app with infinite scroll: 15 | https://github.com/bamlab/rn-camera-roll/tree/master/example 16 | 17 | 18 | 19 | ## Setup 20 | 21 | First, install the package: 22 | ``` 23 | npm install rn-camera-roll 24 | ``` 25 | 26 | Then, follow those instructions: 27 | 28 | ### iOS 29 | 30 | The Camera Roll iOS API is part of `react-native`. 31 | You have to import `node_modules/react-native/Libraries/CameraRoll/RCTCameraRoll.xcodeproj` 32 | by following the [libraries linking instructions](https://facebook.github.io/react-native/docs/linking-libraries-ios.html#here-the-few-steps-to-link-your-libraries-that-contain-native-code). 33 | 34 | ### Android 35 | 36 | #### Update your gradle files 37 | 38 | For **react-native >= v0.15**, this command will do it automatically: 39 | ``` 40 | react-native link rn-camera-roll 41 | ``` 42 | 43 | For **react-native = v0.14** 44 | You will have to update them manually: 45 | 46 | In `android/settings.gradle`, add: 47 | ``` 48 | include ':rn-camera-roll' 49 | project(':rn-camera-roll').projectDir = new File(settingsDir, '../node_modules/rn-camera-roll/android') 50 | ``` 51 | 52 | In `android/app/build.gradle` add: 53 | ``` 54 | dependencies { 55 | ... 56 | compile project(':rn-camera-roll') 57 | } 58 | ``` 59 | 60 | #### Register the package into your `MainActivity` 61 | ```java 62 | package com.example; 63 | 64 | import android.app.Activity; 65 | import android.os.Bundle; 66 | import android.view.KeyEvent; 67 | 68 | import com.facebook.react.LifecycleState; 69 | import com.facebook.react.ReactInstanceManager; 70 | import com.facebook.react.ReactRootView; 71 | import com.facebook.react.modules.core.DefaultHardwareBackBtnHandler; 72 | import com.facebook.react.shell.MainReactPackage; 73 | import com.facebook.soloader.SoLoader; 74 | 75 | // IMPORT HERE 76 | import fr.bamlab.rncameraroll.CameraRollPackage; 77 | // --- 78 | 79 | public class MainActivity extends Activity implements DefaultHardwareBackBtnHandler { 80 | 81 | private ReactInstanceManager mReactInstanceManager; 82 | private ReactRootView mReactRootView; 83 | 84 | @Override 85 | protected void onCreate(Bundle savedInstanceState) { 86 | super.onCreate(savedInstanceState); 87 | mReactRootView = new ReactRootView(this); 88 | 89 | mReactInstanceManager = ReactInstanceManager.builder() 90 | .setApplication(getApplication()) 91 | .setBundleAssetName("index.android.bundle") 92 | .setJSMainModuleName("index.android") 93 | .addPackage(new MainReactPackage()) 94 | 95 | // REGISTER PACKAGE HERE 96 | .addPackage(new CameraRollPackage()) 97 | // --- 98 | .setUseDeveloperSupport(BuildConfig.DEBUG) 99 | .setInitialLifecycleState(LifecycleState.RESUMED) 100 | .build(); 101 | 102 | mReactRootView.startReactApplication(mReactInstanceManager, "example", null); 103 | 104 | setContentView(mReactRootView); 105 | } 106 | 107 | ... 108 | ``` 109 | 110 | ## Usage 111 | 112 | You can use the `getPhotos` API as you would with the iOS API with the `after` and the `first` params. 113 | You can use both the `promise` syntax or the `callback` syntax. 114 | 115 | ```javascript 116 | import CameraRoll from 'rn-camera-roll'; 117 | 118 | onPhotosFetchedSuccess(data) { 119 | const photos = data.edges.map((asset) => { 120 | return asset.node.image; 121 | }); 122 | console.log(photos); 123 | /** 124 | On Android, this should log something like: 125 | [ 126 | { 127 | "uri": "file:/storage/emulated/0/DCIM/Camera/IMG_20160120_172426830.jpg", 128 | "width":3006, 129 | "height":5344, 130 | "orientation": 90 131 | }, 132 | { 133 | "uri": "file:/storage/emulated/0/DCIM/Camera/IMG_20160116_153526816_TOP.jpg", 134 | "width": 5344, 135 | "height": 3006, 136 | "orientation": 0 137 | } 138 | ... 139 | ] 140 | **/ 141 | } 142 | 143 | onPhotosFetchError(err) { 144 | // Handle error here 145 | } 146 | 147 | fetchPhotos(count = 10, after) { 148 | CameraRoll.getPhotos({ 149 | // take the first n photos after given photo uri 150 | first: count, 151 | // after 152 | after: "file:/storage/emulated/0/DCIM/Camera/IMG_20151126_115520477.jpg", 153 | }, this.onPhotosFetchedSuccess.bind(this), this.onPhotosFetchError.bind(this)); 154 | } 155 | ``` 156 | 157 | ## Other open-source modules by the folks at [BAM](http://github.com/bamlab) 158 | 159 | * [react-native-image-resizer](https://github.com/bamlab/react-native-image-resizer) 160 | * [react-native-animated-picker](https://github.com/bamlab/react-native-animated-picker) 161 | * [cordova-plugin-native-routing](https://github.com/bamlab/cordova-plugin-native-routing) 162 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | 3 | android { 4 | compileSdkVersion 23 5 | buildToolsVersion "23.0.2" 6 | 7 | defaultConfig { 8 | minSdkVersion 16 9 | targetSdkVersion 23 10 | versionCode 1 11 | versionName "1.0" 12 | } 13 | buildTypes { 14 | release { 15 | minifyEnabled false 16 | } 17 | } 18 | } 19 | 20 | dependencies { 21 | compile 'com.android.support:appcompat-v7:23.1.0' 22 | compile 'com.facebook.react:react-native:0.14.+' 23 | } 24 | -------------------------------------------------------------------------------- /android/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /android/src/main/java/fr/bamlab/rncameraroll/CameraImage.java: -------------------------------------------------------------------------------- 1 | package fr.bamlab.rncameraroll; 2 | 3 | import android.graphics.BitmapFactory; 4 | import android.media.ExifInterface; 5 | 6 | import java.io.IOException; 7 | import java.text.SimpleDateFormat; 8 | 9 | /** 10 | * Created by florian on 02/12/15. 11 | */ 12 | class CameraImage { 13 | private String localPath; 14 | private int width; 15 | private int height; 16 | private int orientation; 17 | private long timestamp; 18 | 19 | CameraImage(String localPath) { 20 | this.localPath = localPath; 21 | 22 | computeDimensions(); 23 | computeExifProperties(); 24 | } 25 | 26 | private void computeExifProperties() { 27 | ExifInterface exif; 28 | try { 29 | exif = new ExifInterface(localPath); 30 | } catch(IOException e) { 31 | return; 32 | } 33 | 34 | computeOrientation(exif); 35 | computeTimestamp(exif); 36 | } 37 | 38 | private void computeDimensions() { 39 | BitmapFactory.Options options = new BitmapFactory.Options(); 40 | options.inJustDecodeBounds = true; //Avoid decoding the entire file 41 | 42 | BitmapFactory.decodeFile(this.localPath, options); 43 | width = options.outWidth; 44 | height = options.outHeight; 45 | } 46 | 47 | private void computeOrientation(ExifInterface exif) { 48 | int exifOrientation = exif.getAttributeInt( 49 | ExifInterface.TAG_ORIENTATION, 50 | ExifInterface.ORIENTATION_NORMAL); 51 | 52 | switch (exifOrientation) { 53 | case ExifInterface.ORIENTATION_ROTATE_90: 54 | orientation = 90; 55 | break; 56 | 57 | case ExifInterface.ORIENTATION_ROTATE_180: 58 | orientation = 180; 59 | break; 60 | 61 | case ExifInterface.ORIENTATION_ROTATE_270: 62 | orientation = 270; 63 | break; 64 | } 65 | } 66 | 67 | private void computeTimestamp(ExifInterface exif) { 68 | SimpleDateFormat fmt = new SimpleDateFormat("yyyy:MM:dd HH:mm:ss"); 69 | String dateString = exif.getAttribute(ExifInterface.TAG_DATETIME); 70 | 71 | try { 72 | timestamp = fmt.parse(dateString).getTime() / 1000; 73 | } catch (Exception e) { 74 | // Can't retrieve the timestamp, let it be 0. 75 | } 76 | } 77 | 78 | public String getLocalPath() { 79 | return localPath; 80 | } 81 | 82 | public int getWidth() { 83 | return width; 84 | } 85 | 86 | public int getHeight() { 87 | return height; 88 | } 89 | 90 | public int getOrientation() { 91 | return orientation; 92 | } 93 | 94 | public long getTimestamp() { 95 | return timestamp; 96 | } 97 | } 98 | -------------------------------------------------------------------------------- /android/src/main/java/fr/bamlab/rncameraroll/CameraImagesManager.java: -------------------------------------------------------------------------------- 1 | package fr.bamlab.rncameraroll; 2 | 3 | import android.content.Context; 4 | import android.database.Cursor; 5 | import android.graphics.BitmapFactory; 6 | import android.os.Environment; 7 | import android.provider.MediaStore; 8 | 9 | import java.util.ArrayList; 10 | import java.util.List; 11 | 12 | /** 13 | * Created by almouro on 11/12/15. 14 | */ 15 | class CameraImagesManager { 16 | public static List getCameraImages(Context context, int count, String afterCursor) { 17 | final Cursor cursor = context.getContentResolver().query(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, 18 | null, 19 | null, 20 | null, 21 | null 22 | ); 23 | 24 | ArrayList cameraImagePaths = new ArrayList<>(); 25 | 26 | if (cursor == null) { 27 | return cameraImagePaths; 28 | } 29 | 30 | boolean foundAfter = false; 31 | if (cursor.moveToLast()) { 32 | final int dataColumn = cursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA); 33 | do { 34 | String localPath = cursor.getString(dataColumn); 35 | 36 | if (!afterCursor.isEmpty() && !foundAfter) { 37 | if (afterCursor.equals(localPath)) { 38 | foundAfter = true; 39 | } 40 | continue; // Skip until we get to the first one 41 | } 42 | 43 | cameraImagePaths.add(new CameraImage(localPath)); 44 | } while (cursor.moveToPrevious() && cameraImagePaths.size() < count); 45 | } 46 | cursor.close(); 47 | 48 | return cameraImagePaths; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /android/src/main/java/fr/bamlab/rncameraroll/CameraRollModule.java: -------------------------------------------------------------------------------- 1 | package fr.bamlab.rncameraroll; 2 | 3 | import android.content.Context; 4 | import android.graphics.Camera; 5 | 6 | import com.facebook.react.bridge.ReactApplicationContext; 7 | import com.facebook.react.bridge.ReactContextBaseJavaModule; 8 | import com.facebook.react.bridge.ReactMethod; 9 | import com.facebook.react.bridge.Callback; 10 | import com.facebook.react.bridge.ReadableMap; 11 | import com.facebook.react.bridge.WritableArray; 12 | import com.facebook.react.bridge.WritableMap; 13 | import com.facebook.react.bridge.WritableNativeArray; 14 | import com.facebook.react.bridge.WritableNativeMap; 15 | 16 | /** 17 | * Created by almouro on 11/12/15. 18 | */ 19 | class CameraRollModule extends ReactContextBaseJavaModule { 20 | private Context context; 21 | 22 | public CameraRollModule(ReactApplicationContext reactContext) { 23 | super(reactContext); 24 | this.context = reactContext; 25 | } 26 | 27 | /** 28 | * @return the name of this module. This will be the name used to {@code require()} this module 29 | * from javascript. 30 | */ 31 | @Override 32 | public String getName() { 33 | return "CameraRollAndroid"; 34 | } 35 | 36 | @ReactMethod 37 | public void getCameraImages(ReadableMap data, Callback onSuccess) { 38 | WritableNativeArray result = new WritableNativeArray(); 39 | 40 | for(CameraImage imageData : CameraImagesManager.getCameraImages(this.context, 41 | data.getInt("first"), data.hasKey("after") ? data.getString("after") : "")) { 42 | WritableMap imageDataMap = new WritableNativeMap(); 43 | imageDataMap.putString("uri", imageData.getLocalPath()); 44 | imageDataMap.putInt("width", imageData.getWidth()); 45 | imageDataMap.putInt("height", imageData.getHeight()); 46 | imageDataMap.putInt("orientation", imageData.getOrientation()); 47 | imageDataMap.putString("timestamp", Long.toString(imageData.getTimestamp())); 48 | 49 | result.pushMap(imageDataMap); 50 | } 51 | 52 | onSuccess.invoke(result); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /android/src/main/java/fr/bamlab/rncameraroll/CameraRollPackage.java: -------------------------------------------------------------------------------- 1 | package fr.bamlab.rncameraroll; 2 | 3 | import com.facebook.react.ReactPackage; 4 | import com.facebook.react.bridge.JavaScriptModule; 5 | import com.facebook.react.bridge.NativeModule; 6 | import com.facebook.react.bridge.ReactApplicationContext; 7 | import com.facebook.react.uimanager.ViewManager; 8 | 9 | import java.util.ArrayList; 10 | import java.util.Collections; 11 | import java.util.List; 12 | 13 | /** 14 | * Created by almouro on 11/12/15. 15 | */ 16 | public class CameraRollPackage implements ReactPackage { 17 | /** 18 | * @param reactContext react application context that can be used to create modules 19 | * @return list of native modules to register with the newly created catalyst instance 20 | */ 21 | @Override 22 | public List createNativeModules(ReactApplicationContext reactContext) { 23 | List modules = new ArrayList<>(); 24 | modules.add(new CameraRollModule(reactContext)); 25 | 26 | return modules; 27 | } 28 | 29 | /** 30 | * @return list of JS modules to register with the newly created catalyst instance. 31 | *

32 | * IMPORTANT: Note that only modules that needs to be accessible from the native code should be 33 | * listed here. Also listing a native module here doesn't imply that the JS implementation of it 34 | * will be automatically included in the JS bundle. 35 | */ 36 | @Override 37 | public List> createJSModules() { 38 | return Collections.emptyList(); 39 | } 40 | 41 | /** 42 | * @param reactContext 43 | * @return a list of view managers that should be registered with {@link UIManagerModule} 44 | */ 45 | @Override 46 | public List createViewManagers(ReactApplicationContext reactContext) { 47 | return Collections.emptyList(); 48 | } 49 | } 50 | 51 | -------------------------------------------------------------------------------- /example/.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/React.js 13 | .*/node_modules/react-tools/src/renderers/shared/event/EventPropagators.js 14 | .*/node_modules/react-tools/src/renderers/shared/event/eventPlugins/ResponderEventPlugin.js 15 | .*/node_modules/react-tools/src/shared/vendor/core/ExecutionEnvironment.js 16 | 17 | # Ignore commoner tests 18 | .*/node_modules/commoner/test/.* 19 | 20 | # See https://github.com/facebook/flow/issues/442 21 | .*/react-tools/node_modules/commoner/lib/reader.js 22 | 23 | # Ignore jest 24 | .*/node_modules/jest-cli/.* 25 | 26 | # Ignore Website 27 | .*/website/.* 28 | 29 | [include] 30 | 31 | [libs] 32 | node_modules/react-native/Libraries/react-native/react-native-interface.js 33 | 34 | [options] 35 | module.system=haste 36 | 37 | munge_underscores=true 38 | 39 | module.name_mapper='^image![a-zA-Z0-9$_-]+$' -> 'GlobalImageStub' 40 | module.name_mapper='^[./a-zA-Z0-9$_-]+\.png$' -> 'RelativeImageStub' 41 | 42 | suppress_type=$FlowIssue 43 | suppress_type=$FlowFixMe 44 | suppress_type=$FixMe 45 | 46 | suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(1[0-8]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\) 47 | suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(1[0-8]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)? #[0-9]+ 48 | suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy 49 | 50 | [version] 51 | 0.18.1 52 | -------------------------------------------------------------------------------- /example/.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 | # Android/IJ 26 | # 27 | .idea 28 | .gradle 29 | local.properties 30 | 31 | # node.js 32 | # 33 | node_modules/ 34 | npm-debug.log 35 | -------------------------------------------------------------------------------- /example/.watchmanconfig: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /example/CameraRollGallery.js: -------------------------------------------------------------------------------- 1 | import React, { 2 | Component, 3 | Image, 4 | Platform, 5 | PropTypes, 6 | ListView, 7 | View, 8 | Text, 9 | } from 'react-native'; 10 | import CameraRoll from 'rn-camera-roll'; 11 | 12 | const styles = { 13 | container: { 14 | flex: 1, 15 | backgroundColor: '#F5FCFF', 16 | }, 17 | imageGrid: { 18 | flexDirection: 'row', 19 | flexWrap: 'wrap', 20 | justifyContent: 'center', 21 | }, 22 | image: { 23 | width: 100, 24 | height: 100, 25 | margin: 10, 26 | }, 27 | }; 28 | 29 | let PHOTOS_COUNT_BY_FETCH = 24; 30 | 31 | export default class CameraRollGallery extends Component { 32 | 33 | constructor(props) { 34 | super(props); 35 | 36 | this.ds = new ListView.DataSource({rowHasChanged: (r1, r2) => r1 !== r2}); 37 | this.lastPhotoFetched = undefined; // Using `null` would crash ReactNative CameraRoll on iOS. 38 | this.images = []; 39 | this.state = this.getDataSourceState(); 40 | this.fetchPhotos(); 41 | } 42 | 43 | getDataSourceState() { 44 | return { 45 | dataSource: this.ds.cloneWithRows(this.images), 46 | }; 47 | } 48 | 49 | getPhotosFromCameraRollData(data) { 50 | return data.edges.map((asset) => { 51 | return asset.node.image; 52 | }); 53 | } 54 | 55 | onPhotosFetchedSuccess(data) { 56 | const newPhotos = this.getPhotosFromCameraRollData(data); 57 | console.log(data); 58 | this.images = this.images.concat(newPhotos); 59 | this.setState(this.getDataSourceState()); 60 | if (newPhotos.length) this.lastPhotoFetched = newPhotos[newPhotos.length - 1].uri; 61 | } 62 | 63 | onPhotosFetchError(err) { 64 | // Handle error here 65 | console.log(err); 66 | } 67 | 68 | fetchPhotos(count = PHOTOS_COUNT_BY_FETCH, after) { 69 | CameraRoll.getPhotos({ 70 | first: count, 71 | after, 72 | }, this.onPhotosFetchedSuccess.bind(this), this.onPhotosFetchError.bind(this)); 73 | } 74 | 75 | onEndReached() { 76 | this.fetchPhotos(PHOTOS_COUNT_BY_FETCH, this.lastPhotoFetched); 77 | } 78 | 79 | render() { 80 | return ( 81 | 82 | {return ( 89 | 90 | 94 | 95 | )}} 96 | /> 97 | 98 | ); 99 | } 100 | } 101 | -------------------------------------------------------------------------------- /example/android/app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: "com.android.application" 2 | 3 | /** 4 | * The react.gradle file registers two tasks: bundleDebugJsAndAssets and bundleReleaseJsAndAssets. 5 | * These basically call `react-native bundle` with the correct arguments during the Android build 6 | * cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the 7 | * bundle directly from the development server. Below you can see all the possible configurations 8 | * and their defaults. If you decide to add a configuration block, make sure to add it before the 9 | * `apply from: "react.gradle"` line. 10 | * 11 | * project.ext.react = [ 12 | * // the name of the generated asset file containing your JS bundle 13 | * bundleAssetName: "index.android.bundle", 14 | * 15 | * // the entry file for bundle generation 16 | * entryFile: "index.android.js", 17 | * 18 | * // whether to bundle JS and assets in debug mode 19 | * bundleInDebug: false, 20 | * 21 | * // whether to bundle JS and assets in release mode 22 | * bundleInRelease: true, 23 | * 24 | * // the root of your project, i.e. where "package.json" lives 25 | * root: "../../", 26 | * 27 | * // where to put the JS bundle asset in debug mode 28 | * jsBundleDirDebug: "$buildDir/intermediates/assets/debug", 29 | * 30 | * // where to put the JS bundle asset in release mode 31 | * jsBundleDirRelease: "$buildDir/intermediates/assets/release", 32 | * 33 | * // where to put drawable resources / React Native assets, e.g. the ones you use via 34 | * // require('./image.png')), in debug mode 35 | * resourcesDirDebug: "$buildDir/intermediates/res/merged/debug", 36 | * 37 | * // where to put drawable resources / React Native assets, e.g. the ones you use via 38 | * // require('./image.png')), in release mode 39 | * resourcesDirRelease: "$buildDir/intermediates/res/merged/release", 40 | * 41 | * // by default the gradle tasks are skipped if none of the JS files or assets change; this means 42 | * // that we don't look at files in android/ or ios/ to determine whether the tasks are up to 43 | * // date; if you have any other folders that you want to ignore for performance reasons (gradle 44 | * // indexes the entire tree), add them here. Alternatively, if you have JS files in android/ 45 | * // for example, you might want to remove it from here. 46 | * inputExcludes: ["android/**", "ios/**"] 47 | * ] 48 | */ 49 | 50 | apply from: "react.gradle" 51 | 52 | android { 53 | compileSdkVersion 23 54 | buildToolsVersion "23.0.1" 55 | 56 | defaultConfig { 57 | applicationId "com.example" 58 | minSdkVersion 16 59 | targetSdkVersion 22 60 | versionCode 1 61 | versionName "1.0" 62 | ndk { 63 | abiFilters "armeabi-v7a", "x86" 64 | } 65 | } 66 | buildTypes { 67 | release { 68 | minifyEnabled false // Set this to true to enable Proguard 69 | proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro" 70 | } 71 | } 72 | } 73 | 74 | dependencies { 75 | compile fileTree(dir: "libs", include: ["*.jar"]) 76 | compile "com.android.support:appcompat-v7:23.0.1" 77 | compile "com.facebook.react:react-native:0.15.+" 78 | 79 | compile project(":rn-camera-roll") 80 | compile fileTree(dir: "node_modules/rn-camera-roll/android/libs", include: ["*.jar"]) 81 | } 82 | -------------------------------------------------------------------------------- /example/android/app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /usr/local/Cellar/android-sdk/24.3.3/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | 19 | # Disabling obfuscation is useful if you collect stack traces from production crashes 20 | # (unless you are using a system that supports de-obfuscate the stack traces). 21 | -dontobfuscate 22 | 23 | # React Native 24 | 25 | # Keep our interfaces so they can be used by other ProGuard rules. 26 | # See http://sourceforge.net/p/proguard/bugs/466/ 27 | -keep,allowobfuscation @interface com.facebook.proguard.annotations.DoNotStrip 28 | -keep,allowobfuscation @interface com.facebook.proguard.annotations.KeepGettersAndSetters 29 | 30 | # Do not strip any method/class that is annotated with @DoNotStrip 31 | -keep @com.facebook.proguard.annotations.DoNotStrip class * 32 | -keepclassmembers class * { 33 | @com.facebook.proguard.annotations.DoNotStrip *; 34 | } 35 | 36 | -keepclassmembers @com.facebook.proguard.annotations.KeepGettersAndSetters class * { 37 | void set*(***); 38 | *** get*(); 39 | } 40 | 41 | -keep class * extends com.facebook.react.bridge.JavaScriptModule { *; } 42 | -keep class * extends com.facebook.react.bridge.NativeModule { *; } 43 | -keepclassmembers class * { @com.facebook.react.uimanager.UIProp ; } 44 | -keepclassmembers class * { @com.facebook.react.uimanager.ReactProp ; } 45 | -keepclassmembers class * { @com.facebook.react.uimanager.ReactPropGroup ; } 46 | 47 | # okhttp 48 | 49 | -keepattributes Signature 50 | -keepattributes *Annotation* 51 | -keep class com.squareup.okhttp.** { *; } 52 | -keep interface com.squareup.okhttp.** { *; } 53 | -dontwarn com.squareup.okhttp.** 54 | 55 | # okio 56 | 57 | -keep class sun.misc.Unsafe { *; } 58 | -dontwarn java.nio.file.* 59 | -dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement 60 | -dontwarn okio.** 61 | -------------------------------------------------------------------------------- /example/android/app/react.gradle: -------------------------------------------------------------------------------- 1 | def config = project.hasProperty("react") ? project.react : []; 2 | 3 | def bundleAssetName = config.bundleAssetName ?: "index.android.bundle" 4 | def entryFile = config.entryFile ?: "index.android.js" 5 | 6 | // because elvis operator 7 | def elvisFile(thing) { 8 | return thing ? file(thing) : null; 9 | } 10 | 11 | def reactRoot = elvisFile(config.root) ?: file("../../") 12 | def jsBundleDirDebug = elvisFile(config.jsBundleDirDebug) ?: 13 | file("$buildDir/intermediates/assets/debug") 14 | def jsBundleDirRelease = elvisFile(config.jsBundleDirRelease) ?: 15 | file("$buildDir/intermediates/assets/release") 16 | def resourcesDirDebug = elvisFile(config.resourcesDirDebug) ?: 17 | file("$buildDir/intermediates/res/merged/debug") 18 | def resourcesDirRelease = elvisFile(config.resourcesDirRelease) ?: 19 | file("$buildDir/intermediates/res/merged/release") 20 | def inputExcludes = config.inputExcludes ?: ["android/**", "ios/**"] 21 | 22 | def jsBundleFileDebug = file("$jsBundleDirDebug/$bundleAssetName") 23 | def jsBundleFileRelease = file("$jsBundleDirRelease/$bundleAssetName") 24 | 25 | task bundleDebugJsAndAssets(type: Exec) { 26 | // create dirs if they are not there (e.g. the "clean" task just ran) 27 | doFirst { 28 | jsBundleDirDebug.mkdirs() 29 | resourcesDirDebug.mkdirs() 30 | } 31 | 32 | // set up inputs and outputs so gradle can cache the result 33 | inputs.files fileTree(dir: reactRoot, excludes: inputExcludes) 34 | outputs.dir jsBundleDirDebug 35 | outputs.dir resourcesDirDebug 36 | 37 | // set up the call to the react-native cli 38 | workingDir reactRoot 39 | commandLine "react-native", "bundle", "--platform", "android", "--dev", "true", "--entry-file", 40 | entryFile, "--bundle-output", jsBundleFileDebug, "--assets-dest", resourcesDirDebug 41 | 42 | enabled config.bundleInDebug ?: false 43 | } 44 | 45 | task bundleReleaseJsAndAssets(type: Exec) { 46 | // create dirs if they are not there (e.g. the "clean" task just ran) 47 | doFirst { 48 | jsBundleDirRelease.mkdirs() 49 | resourcesDirRelease.mkdirs() 50 | } 51 | 52 | // set up inputs and outputs so gradle can cache the result 53 | inputs.files fileTree(dir: reactRoot, excludes: inputExcludes) 54 | outputs.dir jsBundleDirRelease 55 | outputs.dir resourcesDirRelease 56 | 57 | // set up the call to the react-native cli 58 | workingDir reactRoot 59 | commandLine "react-native", "bundle", "--platform", "android", "--dev", "false", "--entry-file", 60 | entryFile, "--bundle-output", jsBundleFileRelease, "--assets-dest", resourcesDirRelease 61 | 62 | enabled config.bundleInRelease ?: true 63 | } 64 | 65 | gradle.projectsEvaluated { 66 | // hook bundleDebugJsAndAssets into the android build process 67 | bundleDebugJsAndAssets.dependsOn mergeDebugResources 68 | bundleDebugJsAndAssets.dependsOn mergeDebugAssets 69 | processDebugResources.dependsOn bundleDebugJsAndAssets 70 | 71 | // hook bundleReleaseJsAndAssets into the android build process 72 | bundleReleaseJsAndAssets.dependsOn mergeReleaseResources 73 | bundleReleaseJsAndAssets.dependsOn mergeReleaseAssets 74 | processReleaseResources.dependsOn bundleReleaseJsAndAssets 75 | } 76 | -------------------------------------------------------------------------------- /example/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 11 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /example/android/app/src/main/java/com/example/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.example; 2 | 3 | import android.app.Activity; 4 | import android.os.Bundle; 5 | import android.view.KeyEvent; 6 | 7 | import com.facebook.react.LifecycleState; 8 | import com.facebook.react.ReactInstanceManager; 9 | import com.facebook.react.ReactRootView; 10 | import com.facebook.react.modules.core.DefaultHardwareBackBtnHandler; 11 | import com.facebook.react.shell.MainReactPackage; 12 | import com.facebook.soloader.SoLoader; 13 | 14 | import fr.bamlab.rncameraroll.CameraRollPackage; 15 | 16 | public class MainActivity extends Activity implements DefaultHardwareBackBtnHandler { 17 | 18 | private ReactInstanceManager mReactInstanceManager; 19 | private ReactRootView mReactRootView; 20 | 21 | @Override 22 | protected void onCreate(Bundle savedInstanceState) { 23 | super.onCreate(savedInstanceState); 24 | mReactRootView = new ReactRootView(this); 25 | 26 | mReactInstanceManager = ReactInstanceManager.builder() 27 | .setApplication(getApplication()) 28 | .setBundleAssetName("index.android.bundle") 29 | .setJSMainModuleName("index.android") 30 | .addPackage(new MainReactPackage()) 31 | 32 | // Add Camera Roll for android 33 | .addPackage(new CameraRollPackage()) 34 | .setUseDeveloperSupport(BuildConfig.DEBUG) 35 | .setInitialLifecycleState(LifecycleState.RESUMED) 36 | .build(); 37 | 38 | mReactRootView.startReactApplication(mReactInstanceManager, "example", null); 39 | 40 | setContentView(mReactRootView); 41 | } 42 | 43 | @Override 44 | public boolean onKeyUp(int keyCode, KeyEvent event) { 45 | if (keyCode == KeyEvent.KEYCODE_MENU && mReactInstanceManager != null) { 46 | mReactInstanceManager.showDevOptionsDialog(); 47 | return true; 48 | } 49 | return super.onKeyUp(keyCode, event); 50 | } 51 | 52 | @Override 53 | public void onBackPressed() { 54 | if (mReactInstanceManager != null) { 55 | mReactInstanceManager.onBackPressed(); 56 | } else { 57 | super.onBackPressed(); 58 | } 59 | } 60 | 61 | @Override 62 | public void invokeDefaultOnBackPressed() { 63 | super.onBackPressed(); 64 | } 65 | 66 | @Override 67 | protected void onPause() { 68 | super.onPause(); 69 | 70 | if (mReactInstanceManager != null) { 71 | mReactInstanceManager.onPause(); 72 | } 73 | } 74 | 75 | @Override 76 | protected void onResume() { 77 | super.onResume(); 78 | 79 | if (mReactInstanceManager != null) { 80 | mReactInstanceManager.onResume(this, this); 81 | } 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bamlab/rn-camera-roll/8cbe9e9edadd6c687f111057176fd1b3da94e887/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bamlab/rn-camera-roll/8cbe9e9edadd6c687f111057176fd1b3da94e887/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bamlab/rn-camera-roll/8cbe9e9edadd6c687f111057176fd1b3da94e887/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bamlab/rn-camera-roll/8cbe9e9edadd6c687f111057176fd1b3da94e887/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | example 3 | 4 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/android/build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | repositories { 5 | jcenter() 6 | } 7 | dependencies { 8 | classpath 'com.android.tools.build:gradle:1.3.1' 9 | 10 | // NOTE: Do not place your application dependencies here; they belong 11 | // in the individual module build.gradle files 12 | } 13 | } 14 | 15 | allprojects { 16 | repositories { 17 | mavenLocal() 18 | jcenter() 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /example/android/gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m 13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 14 | 15 | # When configured, Gradle will run in incubating parallel mode. 16 | # This option should only be used with decoupled projects. More details, visit 17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 18 | # org.gradle.parallel=true 19 | 20 | android.useDeprecatedNdk=true 21 | -------------------------------------------------------------------------------- /example/android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bamlab/rn-camera-roll/8cbe9e9edadd6c687f111057176fd1b3da94e887/example/android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /example/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | zipStoreBase=GRADLE_USER_HOME 4 | zipStorePath=wrapper/dists 5 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.4-all.zip 6 | -------------------------------------------------------------------------------- /example/android/gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 10 | DEFAULT_JVM_OPTS="" 11 | 12 | APP_NAME="Gradle" 13 | APP_BASE_NAME=`basename "$0"` 14 | 15 | # Use the maximum available, or set MAX_FD != -1 to use that value. 16 | MAX_FD="maximum" 17 | 18 | warn ( ) { 19 | echo "$*" 20 | } 21 | 22 | die ( ) { 23 | echo 24 | echo "$*" 25 | echo 26 | exit 1 27 | } 28 | 29 | # OS specific support (must be 'true' or 'false'). 30 | cygwin=false 31 | msys=false 32 | darwin=false 33 | case "`uname`" in 34 | CYGWIN* ) 35 | cygwin=true 36 | ;; 37 | Darwin* ) 38 | darwin=true 39 | ;; 40 | MINGW* ) 41 | msys=true 42 | ;; 43 | esac 44 | 45 | # For Cygwin, ensure paths are in UNIX format before anything is touched. 46 | if $cygwin ; then 47 | [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"` 48 | fi 49 | 50 | # Attempt to set APP_HOME 51 | # Resolve links: $0 may be a link 52 | PRG="$0" 53 | # Need this for relative symlinks. 54 | while [ -h "$PRG" ] ; do 55 | ls=`ls -ld "$PRG"` 56 | link=`expr "$ls" : '.*-> \(.*\)$'` 57 | if expr "$link" : '/.*' > /dev/null; then 58 | PRG="$link" 59 | else 60 | PRG=`dirname "$PRG"`"/$link" 61 | fi 62 | done 63 | SAVED="`pwd`" 64 | cd "`dirname \"$PRG\"`/" >&- 65 | APP_HOME="`pwd -P`" 66 | cd "$SAVED" >&- 67 | 68 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 69 | 70 | # Determine the Java command to use to start the JVM. 71 | if [ -n "$JAVA_HOME" ] ; then 72 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 73 | # IBM's JDK on AIX uses strange locations for the executables 74 | JAVACMD="$JAVA_HOME/jre/sh/java" 75 | else 76 | JAVACMD="$JAVA_HOME/bin/java" 77 | fi 78 | if [ ! -x "$JAVACMD" ] ; then 79 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 80 | 81 | Please set the JAVA_HOME variable in your environment to match the 82 | location of your Java installation." 83 | fi 84 | else 85 | JAVACMD="java" 86 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 87 | 88 | Please set the JAVA_HOME variable in your environment to match the 89 | location of your Java installation." 90 | fi 91 | 92 | # Increase the maximum file descriptors if we can. 93 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then 94 | MAX_FD_LIMIT=`ulimit -H -n` 95 | if [ $? -eq 0 ] ; then 96 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 97 | MAX_FD="$MAX_FD_LIMIT" 98 | fi 99 | ulimit -n $MAX_FD 100 | if [ $? -ne 0 ] ; then 101 | warn "Could not set maximum file descriptor limit: $MAX_FD" 102 | fi 103 | else 104 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 105 | fi 106 | fi 107 | 108 | # For Darwin, add options to specify how the application appears in the dock 109 | if $darwin; then 110 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 111 | fi 112 | 113 | # For Cygwin, switch paths to Windows format before running java 114 | if $cygwin ; then 115 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 116 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 117 | 118 | # We build the pattern for arguments to be converted via cygpath 119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 120 | SEP="" 121 | for dir in $ROOTDIRSRAW ; do 122 | ROOTDIRS="$ROOTDIRS$SEP$dir" 123 | SEP="|" 124 | done 125 | OURCYGPATTERN="(^($ROOTDIRS))" 126 | # Add a user-defined pattern to the cygpath arguments 127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 129 | fi 130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 131 | i=0 132 | for arg in "$@" ; do 133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 135 | 136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 138 | else 139 | eval `echo args$i`="\"$arg\"" 140 | fi 141 | i=$((i+1)) 142 | done 143 | case $i in 144 | (0) set -- ;; 145 | (1) set -- "$args0" ;; 146 | (2) set -- "$args0" "$args1" ;; 147 | (3) set -- "$args0" "$args1" "$args2" ;; 148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 154 | esac 155 | fi 156 | 157 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules 158 | function splitJvmOpts() { 159 | JVM_OPTS=("$@") 160 | } 161 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS 162 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" 163 | 164 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" 165 | -------------------------------------------------------------------------------- /example/android/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /example/android/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'example' 2 | 3 | include ':app' 4 | 5 | // rn-camera-roll dependency 6 | include ':rn-camera-roll' 7 | project(':rn-camera-roll').projectDir = new File(rootProject.projectDir, '../node_modules/rn-camera-roll/android') 8 | -------------------------------------------------------------------------------- /example/index.android.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Sample React Native App 3 | * https://github.com/facebook/react-native 4 | */ 5 | 'use strict'; 6 | 7 | import React, { 8 | AppRegistry, 9 | } from 'react-native'; 10 | 11 | AppRegistry.registerComponent('example', () => require('./CameraRollGallery')); 12 | -------------------------------------------------------------------------------- /example/index.ios.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Sample React Native App 3 | * https://github.com/facebook/react-native 4 | */ 5 | 'use strict'; 6 | 7 | import React, { 8 | AppRegistry, 9 | } from 'react-native'; 10 | 11 | AppRegistry.registerComponent('example', () => require('./CameraRollGallery')); 12 | -------------------------------------------------------------------------------- /example/ios/example.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 00C302E51ABCBA2D00DB3ED1 /* libRCTActionSheet.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */; }; 11 | 00C302E71ABCBA2D00DB3ED1 /* libRCTGeolocation.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */; }; 12 | 00C302E81ABCBA2D00DB3ED1 /* libRCTImage.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302C01ABCB91800DB3ED1 /* libRCTImage.a */; }; 13 | 00C302E91ABCBA2D00DB3ED1 /* libRCTNetwork.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302DC1ABCB9D200DB3ED1 /* libRCTNetwork.a */; }; 14 | 00C302EA1ABCBA2D00DB3ED1 /* libRCTVibration.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302E41ABCB9EE00DB3ED1 /* libRCTVibration.a */; }; 15 | 00E356F31AD99517003FC87E /* exampleTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* exampleTests.m */; }; 16 | 133E29F31AD74F7200F7D852 /* libRCTLinking.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 78C398B91ACF4ADC00677621 /* libRCTLinking.a */; }; 17 | 139105C61AF99C1200B5F7CC /* libRCTSettings.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 139105C11AF99BAD00B5F7CC /* libRCTSettings.a */; }; 18 | 139FDEF61B0652A700C62182 /* libRCTWebSocket.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 139FDEF41B06529B00C62182 /* libRCTWebSocket.a */; }; 19 | 13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.m */; }; 20 | 13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB11A68108700A75B9A /* LaunchScreen.xib */; }; 21 | 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; }; 22 | 13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; }; 23 | 146834051AC3E58100842450 /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 146834041AC3E56700842450 /* libReact.a */; }; 24 | 832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 832341B51AAA6A8300B99B32 /* libRCTText.a */; }; 25 | B64EF1131C0A4F40009F30DA /* libRCTCameraRoll.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B600A6821C0A4E6D00B248CF /* libRCTCameraRoll.a */; }; 26 | /* End PBXBuildFile section */ 27 | 28 | /* Begin PBXContainerItemProxy section */ 29 | 00C302AB1ABCB8CE00DB3ED1 /* PBXContainerItemProxy */ = { 30 | isa = PBXContainerItemProxy; 31 | containerPortal = 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */; 32 | proxyType = 2; 33 | remoteGlobalIDString = 134814201AA4EA6300B7C361; 34 | remoteInfo = RCTActionSheet; 35 | }; 36 | 00C302B91ABCB90400DB3ED1 /* PBXContainerItemProxy */ = { 37 | isa = PBXContainerItemProxy; 38 | containerPortal = 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */; 39 | proxyType = 2; 40 | remoteGlobalIDString = 134814201AA4EA6300B7C361; 41 | remoteInfo = RCTGeolocation; 42 | }; 43 | 00C302BF1ABCB91800DB3ED1 /* PBXContainerItemProxy */ = { 44 | isa = PBXContainerItemProxy; 45 | containerPortal = 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */; 46 | proxyType = 2; 47 | remoteGlobalIDString = 58B5115D1A9E6B3D00147676; 48 | remoteInfo = RCTImage; 49 | }; 50 | 00C302DB1ABCB9D200DB3ED1 /* PBXContainerItemProxy */ = { 51 | isa = PBXContainerItemProxy; 52 | containerPortal = 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */; 53 | proxyType = 2; 54 | remoteGlobalIDString = 58B511DB1A9E6C8500147676; 55 | remoteInfo = RCTNetwork; 56 | }; 57 | 00C302E31ABCB9EE00DB3ED1 /* PBXContainerItemProxy */ = { 58 | isa = PBXContainerItemProxy; 59 | containerPortal = 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */; 60 | proxyType = 2; 61 | remoteGlobalIDString = 832C81801AAF6DEF007FA2F7; 62 | remoteInfo = RCTVibration; 63 | }; 64 | 00E356F41AD99517003FC87E /* PBXContainerItemProxy */ = { 65 | isa = PBXContainerItemProxy; 66 | containerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */; 67 | proxyType = 1; 68 | remoteGlobalIDString = 13B07F861A680F5B00A75B9A; 69 | remoteInfo = example; 70 | }; 71 | 139105C01AF99BAD00B5F7CC /* PBXContainerItemProxy */ = { 72 | isa = PBXContainerItemProxy; 73 | containerPortal = 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */; 74 | proxyType = 2; 75 | remoteGlobalIDString = 134814201AA4EA6300B7C361; 76 | remoteInfo = RCTSettings; 77 | }; 78 | 139FDEF31B06529B00C62182 /* PBXContainerItemProxy */ = { 79 | isa = PBXContainerItemProxy; 80 | containerPortal = 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */; 81 | proxyType = 2; 82 | remoteGlobalIDString = 3C86DF461ADF2C930047B81A; 83 | remoteInfo = RCTWebSocket; 84 | }; 85 | 146834031AC3E56700842450 /* PBXContainerItemProxy */ = { 86 | isa = PBXContainerItemProxy; 87 | containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */; 88 | proxyType = 2; 89 | remoteGlobalIDString = 83CBBA2E1A601D0E00E9B192; 90 | remoteInfo = React; 91 | }; 92 | 78C398B81ACF4ADC00677621 /* PBXContainerItemProxy */ = { 93 | isa = PBXContainerItemProxy; 94 | containerPortal = 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */; 95 | proxyType = 2; 96 | remoteGlobalIDString = 134814201AA4EA6300B7C361; 97 | remoteInfo = RCTLinking; 98 | }; 99 | 832341B41AAA6A8300B99B32 /* PBXContainerItemProxy */ = { 100 | isa = PBXContainerItemProxy; 101 | containerPortal = 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */; 102 | proxyType = 2; 103 | remoteGlobalIDString = 58B5119B1A9E6C1200147676; 104 | remoteInfo = RCTText; 105 | }; 106 | B600A6811C0A4E6D00B248CF /* PBXContainerItemProxy */ = { 107 | isa = PBXContainerItemProxy; 108 | containerPortal = B600A67C1C0A4E6C00B248CF /* RCTCameraRoll.xcodeproj */; 109 | proxyType = 2; 110 | remoteGlobalIDString = 58B5115D1A9E6B3D00147676; 111 | remoteInfo = RCTCameraRoll; 112 | }; 113 | /* End PBXContainerItemProxy section */ 114 | 115 | /* Begin PBXFileReference section */ 116 | 008F07F21AC5B25A0029DE68 /* main.jsbundle */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = main.jsbundle; sourceTree = ""; }; 117 | 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTActionSheet.xcodeproj; path = "../node_modules/react-native/Libraries/ActionSheetIOS/RCTActionSheet.xcodeproj"; sourceTree = ""; }; 118 | 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTGeolocation.xcodeproj; path = "../node_modules/react-native/Libraries/Geolocation/RCTGeolocation.xcodeproj"; sourceTree = ""; }; 119 | 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTImage.xcodeproj; path = "../node_modules/react-native/Libraries/Image/RCTImage.xcodeproj"; sourceTree = ""; }; 120 | 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTNetwork.xcodeproj; path = "../node_modules/react-native/Libraries/Network/RCTNetwork.xcodeproj"; sourceTree = ""; }; 121 | 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTVibration.xcodeproj; path = "../node_modules/react-native/Libraries/Vibration/RCTVibration.xcodeproj"; sourceTree = ""; }; 122 | 00E356EE1AD99517003FC87E /* exampleTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = exampleTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 123 | 00E356F11AD99517003FC87E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 124 | 00E356F21AD99517003FC87E /* exampleTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = exampleTests.m; sourceTree = ""; }; 125 | 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTSettings.xcodeproj; path = "../node_modules/react-native/Libraries/Settings/RCTSettings.xcodeproj"; sourceTree = ""; }; 126 | 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTWebSocket.xcodeproj; path = "../node_modules/react-native/Libraries/WebSocket/RCTWebSocket.xcodeproj"; sourceTree = ""; }; 127 | 13B07F961A680F5B00A75B9A /* example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = example.app; sourceTree = BUILT_PRODUCTS_DIR; }; 128 | 13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = example/AppDelegate.h; sourceTree = ""; }; 129 | 13B07FB01A68108700A75B9A /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AppDelegate.m; path = example/AppDelegate.m; sourceTree = ""; }; 130 | 13B07FB21A68108700A75B9A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; 131 | 13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = example/Images.xcassets; sourceTree = ""; }; 132 | 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = example/Info.plist; sourceTree = ""; }; 133 | 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = example/main.m; sourceTree = ""; }; 134 | 146833FF1AC3E56700842450 /* React.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = React.xcodeproj; path = "../node_modules/react-native/React/React.xcodeproj"; sourceTree = ""; }; 135 | 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTLinking.xcodeproj; path = "../node_modules/react-native/Libraries/LinkingIOS/RCTLinking.xcodeproj"; sourceTree = ""; }; 136 | 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTText.xcodeproj; path = "../node_modules/react-native/Libraries/Text/RCTText.xcodeproj"; sourceTree = ""; }; 137 | B600A67C1C0A4E6C00B248CF /* RCTCameraRoll.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTCameraRoll.xcodeproj; path = "../node_modules/react-native/Libraries/CameraRoll/RCTCameraRoll.xcodeproj"; sourceTree = ""; }; 138 | /* End PBXFileReference section */ 139 | 140 | /* Begin PBXFrameworksBuildPhase section */ 141 | 00E356EB1AD99517003FC87E /* Frameworks */ = { 142 | isa = PBXFrameworksBuildPhase; 143 | buildActionMask = 2147483647; 144 | files = ( 145 | ); 146 | runOnlyForDeploymentPostprocessing = 0; 147 | }; 148 | 13B07F8C1A680F5B00A75B9A /* Frameworks */ = { 149 | isa = PBXFrameworksBuildPhase; 150 | buildActionMask = 2147483647; 151 | files = ( 152 | B64EF1131C0A4F40009F30DA /* libRCTCameraRoll.a in Frameworks */, 153 | 146834051AC3E58100842450 /* libReact.a in Frameworks */, 154 | 00C302E51ABCBA2D00DB3ED1 /* libRCTActionSheet.a in Frameworks */, 155 | 00C302E71ABCBA2D00DB3ED1 /* libRCTGeolocation.a in Frameworks */, 156 | 00C302E81ABCBA2D00DB3ED1 /* libRCTImage.a in Frameworks */, 157 | 133E29F31AD74F7200F7D852 /* libRCTLinking.a in Frameworks */, 158 | 00C302E91ABCBA2D00DB3ED1 /* libRCTNetwork.a in Frameworks */, 159 | 139105C61AF99C1200B5F7CC /* libRCTSettings.a in Frameworks */, 160 | 832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */, 161 | 00C302EA1ABCBA2D00DB3ED1 /* libRCTVibration.a in Frameworks */, 162 | 139FDEF61B0652A700C62182 /* libRCTWebSocket.a in Frameworks */, 163 | ); 164 | runOnlyForDeploymentPostprocessing = 0; 165 | }; 166 | /* End PBXFrameworksBuildPhase section */ 167 | 168 | /* Begin PBXGroup section */ 169 | 00C302A81ABCB8CE00DB3ED1 /* Products */ = { 170 | isa = PBXGroup; 171 | children = ( 172 | 00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */, 173 | ); 174 | name = Products; 175 | sourceTree = ""; 176 | }; 177 | 00C302B61ABCB90400DB3ED1 /* Products */ = { 178 | isa = PBXGroup; 179 | children = ( 180 | 00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */, 181 | ); 182 | name = Products; 183 | sourceTree = ""; 184 | }; 185 | 00C302BC1ABCB91800DB3ED1 /* Products */ = { 186 | isa = PBXGroup; 187 | children = ( 188 | 00C302C01ABCB91800DB3ED1 /* libRCTImage.a */, 189 | ); 190 | name = Products; 191 | sourceTree = ""; 192 | }; 193 | 00C302D41ABCB9D200DB3ED1 /* Products */ = { 194 | isa = PBXGroup; 195 | children = ( 196 | 00C302DC1ABCB9D200DB3ED1 /* libRCTNetwork.a */, 197 | ); 198 | name = Products; 199 | sourceTree = ""; 200 | }; 201 | 00C302E01ABCB9EE00DB3ED1 /* Products */ = { 202 | isa = PBXGroup; 203 | children = ( 204 | 00C302E41ABCB9EE00DB3ED1 /* libRCTVibration.a */, 205 | ); 206 | name = Products; 207 | sourceTree = ""; 208 | }; 209 | 00E356EF1AD99517003FC87E /* exampleTests */ = { 210 | isa = PBXGroup; 211 | children = ( 212 | 00E356F21AD99517003FC87E /* exampleTests.m */, 213 | 00E356F01AD99517003FC87E /* Supporting Files */, 214 | ); 215 | path = exampleTests; 216 | sourceTree = ""; 217 | }; 218 | 00E356F01AD99517003FC87E /* Supporting Files */ = { 219 | isa = PBXGroup; 220 | children = ( 221 | 00E356F11AD99517003FC87E /* Info.plist */, 222 | ); 223 | name = "Supporting Files"; 224 | sourceTree = ""; 225 | }; 226 | 139105B71AF99BAD00B5F7CC /* Products */ = { 227 | isa = PBXGroup; 228 | children = ( 229 | 139105C11AF99BAD00B5F7CC /* libRCTSettings.a */, 230 | ); 231 | name = Products; 232 | sourceTree = ""; 233 | }; 234 | 139FDEE71B06529A00C62182 /* Products */ = { 235 | isa = PBXGroup; 236 | children = ( 237 | 139FDEF41B06529B00C62182 /* libRCTWebSocket.a */, 238 | ); 239 | name = Products; 240 | sourceTree = ""; 241 | }; 242 | 13B07FAE1A68108700A75B9A /* example */ = { 243 | isa = PBXGroup; 244 | children = ( 245 | 008F07F21AC5B25A0029DE68 /* main.jsbundle */, 246 | 13B07FAF1A68108700A75B9A /* AppDelegate.h */, 247 | 13B07FB01A68108700A75B9A /* AppDelegate.m */, 248 | 13B07FB51A68108700A75B9A /* Images.xcassets */, 249 | 13B07FB61A68108700A75B9A /* Info.plist */, 250 | 13B07FB11A68108700A75B9A /* LaunchScreen.xib */, 251 | 13B07FB71A68108700A75B9A /* main.m */, 252 | ); 253 | name = example; 254 | sourceTree = ""; 255 | }; 256 | 146834001AC3E56700842450 /* Products */ = { 257 | isa = PBXGroup; 258 | children = ( 259 | 146834041AC3E56700842450 /* libReact.a */, 260 | ); 261 | name = Products; 262 | sourceTree = ""; 263 | }; 264 | 78C398B11ACF4ADC00677621 /* Products */ = { 265 | isa = PBXGroup; 266 | children = ( 267 | 78C398B91ACF4ADC00677621 /* libRCTLinking.a */, 268 | ); 269 | name = Products; 270 | sourceTree = ""; 271 | }; 272 | 832341AE1AAA6A7D00B99B32 /* Libraries */ = { 273 | isa = PBXGroup; 274 | children = ( 275 | B600A67C1C0A4E6C00B248CF /* RCTCameraRoll.xcodeproj */, 276 | 146833FF1AC3E56700842450 /* React.xcodeproj */, 277 | 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */, 278 | 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */, 279 | 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */, 280 | 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */, 281 | 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */, 282 | 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */, 283 | 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */, 284 | 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */, 285 | 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */, 286 | ); 287 | name = Libraries; 288 | sourceTree = ""; 289 | }; 290 | 832341B11AAA6A8300B99B32 /* Products */ = { 291 | isa = PBXGroup; 292 | children = ( 293 | 832341B51AAA6A8300B99B32 /* libRCTText.a */, 294 | ); 295 | name = Products; 296 | sourceTree = ""; 297 | }; 298 | 83CBB9F61A601CBA00E9B192 = { 299 | isa = PBXGroup; 300 | children = ( 301 | 13B07FAE1A68108700A75B9A /* example */, 302 | 832341AE1AAA6A7D00B99B32 /* Libraries */, 303 | 00E356EF1AD99517003FC87E /* exampleTests */, 304 | 83CBBA001A601CBA00E9B192 /* Products */, 305 | ); 306 | indentWidth = 2; 307 | sourceTree = ""; 308 | tabWidth = 2; 309 | }; 310 | 83CBBA001A601CBA00E9B192 /* Products */ = { 311 | isa = PBXGroup; 312 | children = ( 313 | 13B07F961A680F5B00A75B9A /* example.app */, 314 | 00E356EE1AD99517003FC87E /* exampleTests.xctest */, 315 | ); 316 | name = Products; 317 | sourceTree = ""; 318 | }; 319 | B600A67D1C0A4E6C00B248CF /* Products */ = { 320 | isa = PBXGroup; 321 | children = ( 322 | B600A6821C0A4E6D00B248CF /* libRCTCameraRoll.a */, 323 | ); 324 | name = Products; 325 | sourceTree = ""; 326 | }; 327 | /* End PBXGroup section */ 328 | 329 | /* Begin PBXNativeTarget section */ 330 | 00E356ED1AD99517003FC87E /* exampleTests */ = { 331 | isa = PBXNativeTarget; 332 | buildConfigurationList = 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "exampleTests" */; 333 | buildPhases = ( 334 | 00E356EA1AD99517003FC87E /* Sources */, 335 | 00E356EB1AD99517003FC87E /* Frameworks */, 336 | 00E356EC1AD99517003FC87E /* Resources */, 337 | ); 338 | buildRules = ( 339 | ); 340 | dependencies = ( 341 | 00E356F51AD99517003FC87E /* PBXTargetDependency */, 342 | ); 343 | name = exampleTests; 344 | productName = exampleTests; 345 | productReference = 00E356EE1AD99517003FC87E /* exampleTests.xctest */; 346 | productType = "com.apple.product-type.bundle.unit-test"; 347 | }; 348 | 13B07F861A680F5B00A75B9A /* example */ = { 349 | isa = PBXNativeTarget; 350 | buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "example" */; 351 | buildPhases = ( 352 | 13B07F871A680F5B00A75B9A /* Sources */, 353 | 13B07F8C1A680F5B00A75B9A /* Frameworks */, 354 | 13B07F8E1A680F5B00A75B9A /* Resources */, 355 | 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */, 356 | ); 357 | buildRules = ( 358 | ); 359 | dependencies = ( 360 | ); 361 | name = example; 362 | productName = "Hello World"; 363 | productReference = 13B07F961A680F5B00A75B9A /* example.app */; 364 | productType = "com.apple.product-type.application"; 365 | }; 366 | /* End PBXNativeTarget section */ 367 | 368 | /* Begin PBXProject section */ 369 | 83CBB9F71A601CBA00E9B192 /* Project object */ = { 370 | isa = PBXProject; 371 | attributes = { 372 | LastUpgradeCheck = 0610; 373 | ORGANIZATIONNAME = Facebook; 374 | TargetAttributes = { 375 | 00E356ED1AD99517003FC87E = { 376 | CreatedOnToolsVersion = 6.2; 377 | TestTargetID = 13B07F861A680F5B00A75B9A; 378 | }; 379 | }; 380 | }; 381 | buildConfigurationList = 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "example" */; 382 | compatibilityVersion = "Xcode 3.2"; 383 | developmentRegion = English; 384 | hasScannedForEncodings = 0; 385 | knownRegions = ( 386 | en, 387 | Base, 388 | ); 389 | mainGroup = 83CBB9F61A601CBA00E9B192; 390 | productRefGroup = 83CBBA001A601CBA00E9B192 /* Products */; 391 | projectDirPath = ""; 392 | projectReferences = ( 393 | { 394 | ProductGroup = 00C302A81ABCB8CE00DB3ED1 /* Products */; 395 | ProjectRef = 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */; 396 | }, 397 | { 398 | ProductGroup = B600A67D1C0A4E6C00B248CF /* Products */; 399 | ProjectRef = B600A67C1C0A4E6C00B248CF /* RCTCameraRoll.xcodeproj */; 400 | }, 401 | { 402 | ProductGroup = 00C302B61ABCB90400DB3ED1 /* Products */; 403 | ProjectRef = 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */; 404 | }, 405 | { 406 | ProductGroup = 00C302BC1ABCB91800DB3ED1 /* Products */; 407 | ProjectRef = 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */; 408 | }, 409 | { 410 | ProductGroup = 78C398B11ACF4ADC00677621 /* Products */; 411 | ProjectRef = 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */; 412 | }, 413 | { 414 | ProductGroup = 00C302D41ABCB9D200DB3ED1 /* Products */; 415 | ProjectRef = 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */; 416 | }, 417 | { 418 | ProductGroup = 139105B71AF99BAD00B5F7CC /* Products */; 419 | ProjectRef = 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */; 420 | }, 421 | { 422 | ProductGroup = 832341B11AAA6A8300B99B32 /* Products */; 423 | ProjectRef = 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */; 424 | }, 425 | { 426 | ProductGroup = 00C302E01ABCB9EE00DB3ED1 /* Products */; 427 | ProjectRef = 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */; 428 | }, 429 | { 430 | ProductGroup = 139FDEE71B06529A00C62182 /* Products */; 431 | ProjectRef = 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */; 432 | }, 433 | { 434 | ProductGroup = 146834001AC3E56700842450 /* Products */; 435 | ProjectRef = 146833FF1AC3E56700842450 /* React.xcodeproj */; 436 | }, 437 | ); 438 | projectRoot = ""; 439 | targets = ( 440 | 13B07F861A680F5B00A75B9A /* example */, 441 | 00E356ED1AD99517003FC87E /* exampleTests */, 442 | ); 443 | }; 444 | /* End PBXProject section */ 445 | 446 | /* Begin PBXReferenceProxy section */ 447 | 00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */ = { 448 | isa = PBXReferenceProxy; 449 | fileType = archive.ar; 450 | path = libRCTActionSheet.a; 451 | remoteRef = 00C302AB1ABCB8CE00DB3ED1 /* PBXContainerItemProxy */; 452 | sourceTree = BUILT_PRODUCTS_DIR; 453 | }; 454 | 00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */ = { 455 | isa = PBXReferenceProxy; 456 | fileType = archive.ar; 457 | path = libRCTGeolocation.a; 458 | remoteRef = 00C302B91ABCB90400DB3ED1 /* PBXContainerItemProxy */; 459 | sourceTree = BUILT_PRODUCTS_DIR; 460 | }; 461 | 00C302C01ABCB91800DB3ED1 /* libRCTImage.a */ = { 462 | isa = PBXReferenceProxy; 463 | fileType = archive.ar; 464 | path = libRCTImage.a; 465 | remoteRef = 00C302BF1ABCB91800DB3ED1 /* PBXContainerItemProxy */; 466 | sourceTree = BUILT_PRODUCTS_DIR; 467 | }; 468 | 00C302DC1ABCB9D200DB3ED1 /* libRCTNetwork.a */ = { 469 | isa = PBXReferenceProxy; 470 | fileType = archive.ar; 471 | path = libRCTNetwork.a; 472 | remoteRef = 00C302DB1ABCB9D200DB3ED1 /* PBXContainerItemProxy */; 473 | sourceTree = BUILT_PRODUCTS_DIR; 474 | }; 475 | 00C302E41ABCB9EE00DB3ED1 /* libRCTVibration.a */ = { 476 | isa = PBXReferenceProxy; 477 | fileType = archive.ar; 478 | path = libRCTVibration.a; 479 | remoteRef = 00C302E31ABCB9EE00DB3ED1 /* PBXContainerItemProxy */; 480 | sourceTree = BUILT_PRODUCTS_DIR; 481 | }; 482 | 139105C11AF99BAD00B5F7CC /* libRCTSettings.a */ = { 483 | isa = PBXReferenceProxy; 484 | fileType = archive.ar; 485 | path = libRCTSettings.a; 486 | remoteRef = 139105C01AF99BAD00B5F7CC /* PBXContainerItemProxy */; 487 | sourceTree = BUILT_PRODUCTS_DIR; 488 | }; 489 | 139FDEF41B06529B00C62182 /* libRCTWebSocket.a */ = { 490 | isa = PBXReferenceProxy; 491 | fileType = archive.ar; 492 | path = libRCTWebSocket.a; 493 | remoteRef = 139FDEF31B06529B00C62182 /* PBXContainerItemProxy */; 494 | sourceTree = BUILT_PRODUCTS_DIR; 495 | }; 496 | 146834041AC3E56700842450 /* libReact.a */ = { 497 | isa = PBXReferenceProxy; 498 | fileType = archive.ar; 499 | path = libReact.a; 500 | remoteRef = 146834031AC3E56700842450 /* PBXContainerItemProxy */; 501 | sourceTree = BUILT_PRODUCTS_DIR; 502 | }; 503 | 78C398B91ACF4ADC00677621 /* libRCTLinking.a */ = { 504 | isa = PBXReferenceProxy; 505 | fileType = archive.ar; 506 | path = libRCTLinking.a; 507 | remoteRef = 78C398B81ACF4ADC00677621 /* PBXContainerItemProxy */; 508 | sourceTree = BUILT_PRODUCTS_DIR; 509 | }; 510 | 832341B51AAA6A8300B99B32 /* libRCTText.a */ = { 511 | isa = PBXReferenceProxy; 512 | fileType = archive.ar; 513 | path = libRCTText.a; 514 | remoteRef = 832341B41AAA6A8300B99B32 /* PBXContainerItemProxy */; 515 | sourceTree = BUILT_PRODUCTS_DIR; 516 | }; 517 | B600A6821C0A4E6D00B248CF /* libRCTCameraRoll.a */ = { 518 | isa = PBXReferenceProxy; 519 | fileType = archive.ar; 520 | path = libRCTCameraRoll.a; 521 | remoteRef = B600A6811C0A4E6D00B248CF /* PBXContainerItemProxy */; 522 | sourceTree = BUILT_PRODUCTS_DIR; 523 | }; 524 | /* End PBXReferenceProxy section */ 525 | 526 | /* Begin PBXResourcesBuildPhase section */ 527 | 00E356EC1AD99517003FC87E /* Resources */ = { 528 | isa = PBXResourcesBuildPhase; 529 | buildActionMask = 2147483647; 530 | files = ( 531 | ); 532 | runOnlyForDeploymentPostprocessing = 0; 533 | }; 534 | 13B07F8E1A680F5B00A75B9A /* Resources */ = { 535 | isa = PBXResourcesBuildPhase; 536 | buildActionMask = 2147483647; 537 | files = ( 538 | 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */, 539 | 13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */, 540 | ); 541 | runOnlyForDeploymentPostprocessing = 0; 542 | }; 543 | /* End PBXResourcesBuildPhase section */ 544 | 545 | /* Begin PBXShellScriptBuildPhase section */ 546 | 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */ = { 547 | isa = PBXShellScriptBuildPhase; 548 | buildActionMask = 2147483647; 549 | files = ( 550 | ); 551 | inputPaths = ( 552 | ); 553 | name = "Bundle React Native code and images"; 554 | outputPaths = ( 555 | ); 556 | runOnlyForDeploymentPostprocessing = 0; 557 | shellPath = /bin/sh; 558 | shellScript = "../node_modules/react-native/packager/react-native-xcode.sh"; 559 | }; 560 | /* End PBXShellScriptBuildPhase section */ 561 | 562 | /* Begin PBXSourcesBuildPhase section */ 563 | 00E356EA1AD99517003FC87E /* Sources */ = { 564 | isa = PBXSourcesBuildPhase; 565 | buildActionMask = 2147483647; 566 | files = ( 567 | 00E356F31AD99517003FC87E /* exampleTests.m in Sources */, 568 | ); 569 | runOnlyForDeploymentPostprocessing = 0; 570 | }; 571 | 13B07F871A680F5B00A75B9A /* Sources */ = { 572 | isa = PBXSourcesBuildPhase; 573 | buildActionMask = 2147483647; 574 | files = ( 575 | 13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */, 576 | 13B07FC11A68108700A75B9A /* main.m in Sources */, 577 | ); 578 | runOnlyForDeploymentPostprocessing = 0; 579 | }; 580 | /* End PBXSourcesBuildPhase section */ 581 | 582 | /* Begin PBXTargetDependency section */ 583 | 00E356F51AD99517003FC87E /* PBXTargetDependency */ = { 584 | isa = PBXTargetDependency; 585 | target = 13B07F861A680F5B00A75B9A /* example */; 586 | targetProxy = 00E356F41AD99517003FC87E /* PBXContainerItemProxy */; 587 | }; 588 | /* End PBXTargetDependency section */ 589 | 590 | /* Begin PBXVariantGroup section */ 591 | 13B07FB11A68108700A75B9A /* LaunchScreen.xib */ = { 592 | isa = PBXVariantGroup; 593 | children = ( 594 | 13B07FB21A68108700A75B9A /* Base */, 595 | ); 596 | name = LaunchScreen.xib; 597 | path = example; 598 | sourceTree = ""; 599 | }; 600 | /* End PBXVariantGroup section */ 601 | 602 | /* Begin XCBuildConfiguration section */ 603 | 00E356F61AD99517003FC87E /* Debug */ = { 604 | isa = XCBuildConfiguration; 605 | buildSettings = { 606 | BUNDLE_LOADER = "$(TEST_HOST)"; 607 | FRAMEWORK_SEARCH_PATHS = ( 608 | "$(SDKROOT)/Developer/Library/Frameworks", 609 | "$(inherited)", 610 | ); 611 | GCC_PREPROCESSOR_DEFINITIONS = ( 612 | "DEBUG=1", 613 | "$(inherited)", 614 | ); 615 | INFOPLIST_FILE = exampleTests/Info.plist; 616 | IPHONEOS_DEPLOYMENT_TARGET = 8.2; 617 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 618 | PRODUCT_NAME = "$(TARGET_NAME)"; 619 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/example.app/example"; 620 | }; 621 | name = Debug; 622 | }; 623 | 00E356F71AD99517003FC87E /* Release */ = { 624 | isa = XCBuildConfiguration; 625 | buildSettings = { 626 | BUNDLE_LOADER = "$(TEST_HOST)"; 627 | COPY_PHASE_STRIP = NO; 628 | FRAMEWORK_SEARCH_PATHS = ( 629 | "$(SDKROOT)/Developer/Library/Frameworks", 630 | "$(inherited)", 631 | ); 632 | INFOPLIST_FILE = exampleTests/Info.plist; 633 | IPHONEOS_DEPLOYMENT_TARGET = 8.2; 634 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 635 | PRODUCT_NAME = "$(TARGET_NAME)"; 636 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/example.app/example"; 637 | }; 638 | name = Release; 639 | }; 640 | 13B07F941A680F5B00A75B9A /* Debug */ = { 641 | isa = XCBuildConfiguration; 642 | buildSettings = { 643 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 644 | DEAD_CODE_STRIPPING = NO; 645 | HEADER_SEARCH_PATHS = ( 646 | "$(inherited)", 647 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, 648 | "$(SRCROOT)/../node_modules/react-native/React/**", 649 | ); 650 | INFOPLIST_FILE = example/Info.plist; 651 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 652 | OTHER_LDFLAGS = "-ObjC"; 653 | PRODUCT_NAME = example; 654 | }; 655 | name = Debug; 656 | }; 657 | 13B07F951A680F5B00A75B9A /* Release */ = { 658 | isa = XCBuildConfiguration; 659 | buildSettings = { 660 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 661 | HEADER_SEARCH_PATHS = ( 662 | "$(inherited)", 663 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, 664 | "$(SRCROOT)/../node_modules/react-native/React/**", 665 | ); 666 | INFOPLIST_FILE = example/Info.plist; 667 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 668 | OTHER_LDFLAGS = "-ObjC"; 669 | PRODUCT_NAME = example; 670 | }; 671 | name = Release; 672 | }; 673 | 83CBBA201A601CBA00E9B192 /* Debug */ = { 674 | isa = XCBuildConfiguration; 675 | buildSettings = { 676 | ALWAYS_SEARCH_USER_PATHS = NO; 677 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 678 | CLANG_CXX_LIBRARY = "libc++"; 679 | CLANG_ENABLE_MODULES = YES; 680 | CLANG_ENABLE_OBJC_ARC = YES; 681 | CLANG_WARN_BOOL_CONVERSION = YES; 682 | CLANG_WARN_CONSTANT_CONVERSION = YES; 683 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 684 | CLANG_WARN_EMPTY_BODY = YES; 685 | CLANG_WARN_ENUM_CONVERSION = YES; 686 | CLANG_WARN_INT_CONVERSION = YES; 687 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 688 | CLANG_WARN_UNREACHABLE_CODE = YES; 689 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 690 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 691 | COPY_PHASE_STRIP = NO; 692 | ENABLE_STRICT_OBJC_MSGSEND = YES; 693 | GCC_C_LANGUAGE_STANDARD = gnu99; 694 | GCC_DYNAMIC_NO_PIC = NO; 695 | GCC_OPTIMIZATION_LEVEL = 0; 696 | GCC_PREPROCESSOR_DEFINITIONS = ( 697 | "DEBUG=1", 698 | "$(inherited)", 699 | ); 700 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 701 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 702 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 703 | GCC_WARN_UNDECLARED_SELECTOR = YES; 704 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 705 | GCC_WARN_UNUSED_FUNCTION = YES; 706 | GCC_WARN_UNUSED_VARIABLE = YES; 707 | HEADER_SEARCH_PATHS = ( 708 | "$(inherited)", 709 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, 710 | "$(SRCROOT)/../node_modules/react-native/React/**", 711 | ); 712 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 713 | MTL_ENABLE_DEBUG_INFO = YES; 714 | ONLY_ACTIVE_ARCH = YES; 715 | SDKROOT = iphoneos; 716 | }; 717 | name = Debug; 718 | }; 719 | 83CBBA211A601CBA00E9B192 /* Release */ = { 720 | isa = XCBuildConfiguration; 721 | buildSettings = { 722 | ALWAYS_SEARCH_USER_PATHS = NO; 723 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 724 | CLANG_CXX_LIBRARY = "libc++"; 725 | CLANG_ENABLE_MODULES = YES; 726 | CLANG_ENABLE_OBJC_ARC = YES; 727 | CLANG_WARN_BOOL_CONVERSION = YES; 728 | CLANG_WARN_CONSTANT_CONVERSION = YES; 729 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 730 | CLANG_WARN_EMPTY_BODY = YES; 731 | CLANG_WARN_ENUM_CONVERSION = YES; 732 | CLANG_WARN_INT_CONVERSION = YES; 733 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 734 | CLANG_WARN_UNREACHABLE_CODE = YES; 735 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 736 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 737 | COPY_PHASE_STRIP = YES; 738 | ENABLE_NS_ASSERTIONS = NO; 739 | ENABLE_STRICT_OBJC_MSGSEND = YES; 740 | GCC_C_LANGUAGE_STANDARD = gnu99; 741 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 742 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 743 | GCC_WARN_UNDECLARED_SELECTOR = YES; 744 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 745 | GCC_WARN_UNUSED_FUNCTION = YES; 746 | GCC_WARN_UNUSED_VARIABLE = YES; 747 | HEADER_SEARCH_PATHS = ( 748 | "$(inherited)", 749 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, 750 | "$(SRCROOT)/../node_modules/react-native/React/**", 751 | ); 752 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 753 | MTL_ENABLE_DEBUG_INFO = NO; 754 | SDKROOT = iphoneos; 755 | VALIDATE_PRODUCT = YES; 756 | }; 757 | name = Release; 758 | }; 759 | /* End XCBuildConfiguration section */ 760 | 761 | /* Begin XCConfigurationList section */ 762 | 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "exampleTests" */ = { 763 | isa = XCConfigurationList; 764 | buildConfigurations = ( 765 | 00E356F61AD99517003FC87E /* Debug */, 766 | 00E356F71AD99517003FC87E /* Release */, 767 | ); 768 | defaultConfigurationIsVisible = 0; 769 | defaultConfigurationName = Release; 770 | }; 771 | 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "example" */ = { 772 | isa = XCConfigurationList; 773 | buildConfigurations = ( 774 | 13B07F941A680F5B00A75B9A /* Debug */, 775 | 13B07F951A680F5B00A75B9A /* Release */, 776 | ); 777 | defaultConfigurationIsVisible = 0; 778 | defaultConfigurationName = Release; 779 | }; 780 | 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "example" */ = { 781 | isa = XCConfigurationList; 782 | buildConfigurations = ( 783 | 83CBBA201A601CBA00E9B192 /* Debug */, 784 | 83CBBA211A601CBA00E9B192 /* Release */, 785 | ); 786 | defaultConfigurationIsVisible = 0; 787 | defaultConfigurationName = Release; 788 | }; 789 | /* End XCConfigurationList section */ 790 | }; 791 | rootObject = 83CBB9F71A601CBA00E9B192 /* Project object */; 792 | } 793 | -------------------------------------------------------------------------------- /example/ios/example.xcodeproj/xcshareddata/xcschemes/example.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/ios/example/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/ios/example/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?platform=ios&dev=true"]; 35 | 36 | /** 37 | * OPTION 2 38 | * Load from pre-bundled file on disk. The static bundle is automatically 39 | * generated by "Bundle React Native code and images" build step. 40 | */ 41 | 42 | // jsCodeLocation = [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"]; 43 | 44 | RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation 45 | moduleName:@"example" 46 | initialProperties:nil 47 | launchOptions:launchOptions]; 48 | 49 | self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; 50 | UIViewController *rootViewController = [UIViewController new]; 51 | rootViewController.view = rootView; 52 | self.window.rootViewController = rootViewController; 53 | [self.window makeKeyAndVisible]; 54 | return YES; 55 | } 56 | 57 | @end 58 | -------------------------------------------------------------------------------- /example/ios/example/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/ios/example/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/ios/example/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 | NSAppTransportSecurity 42 | 43 | 44 | NSAllowsArbitraryLoads 45 | 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /example/ios/example/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/ios/exampleTests/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/ios/exampleTests/exampleTests.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 "RCTLog.h" 14 | #import "RCTRootView.h" 15 | 16 | #define TIMEOUT_SECONDS 240 17 | #define TEXT_TO_LOOK_FOR @"Welcome to React Native!" 18 | 19 | @interface exampleTests : XCTestCase 20 | 21 | @end 22 | 23 | @implementation exampleTests 24 | 25 | - (BOOL)findSubviewInView:(UIView *)view matching:(BOOL(^)(UIView *view))test 26 | { 27 | if (test(view)) { 28 | return YES; 29 | } 30 | for (UIView *subview in [view subviews]) { 31 | if ([self findSubviewInView:subview matching:test]) { 32 | return YES; 33 | } 34 | } 35 | return NO; 36 | } 37 | 38 | - (void)testRendersWelcomeScreen 39 | { 40 | UIViewController *vc = [[[[UIApplication sharedApplication] delegate] window] rootViewController]; 41 | NSDate *date = [NSDate dateWithTimeIntervalSinceNow:TIMEOUT_SECONDS]; 42 | BOOL foundElement = NO; 43 | 44 | __block NSString *redboxError = nil; 45 | RCTSetLogFunction(^(RCTLogLevel level, NSString *fileName, NSNumber *lineNumber, NSString *message) { 46 | if (level >= RCTLogLevelError) { 47 | redboxError = message; 48 | } 49 | }); 50 | 51 | while ([date timeIntervalSinceNow] > 0 && !foundElement && !redboxError) { 52 | [[NSRunLoop mainRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]; 53 | [[NSRunLoop mainRunLoop] runMode:NSRunLoopCommonModes beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]; 54 | 55 | foundElement = [self findSubviewInView:vc.view matching:^BOOL(UIView *view) { 56 | if ([view.accessibilityLabel isEqualToString:TEXT_TO_LOOK_FOR]) { 57 | return YES; 58 | } 59 | return NO; 60 | }]; 61 | } 62 | 63 | RCTSetLogFunction(RCTDefaultLogFunction); 64 | 65 | XCTAssertNil(redboxError, @"RedBox error: %@", redboxError); 66 | XCTAssertTrue(foundElement, @"Couldn't find element with text '%@' in %d seconds", TEXT_TO_LOOK_FOR, TIMEOUT_SECONDS); 67 | } 68 | 69 | 70 | @end 71 | -------------------------------------------------------------------------------- /example/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "example", 3 | "version": "0.0.1", 4 | "private": true, 5 | "scripts": { 6 | "start": "react-native start" 7 | }, 8 | "dependencies": { 9 | "react-native": "^0.15.0", 10 | "rn-camera-roll": "file:../" 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /example/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bamlab/rn-camera-roll/8cbe9e9edadd6c687f111057176fd1b3da94e887/example/screenshot.png -------------------------------------------------------------------------------- /index.android.js: -------------------------------------------------------------------------------- 1 | import React from 'react-native'; 2 | 3 | const CameraRollAndroid = React.NativeModules.CameraRollAndroid; 4 | const ANDROID_FILE_PREFIX = 'file:'; 5 | 6 | function formatToIosCameraRollFormat(imageDataList) { 7 | return { 8 | edges: imageDataList.map((imageData) => { 9 | return { 10 | node: { 11 | image: { 12 | uri: ANDROID_FILE_PREFIX + imageData.uri, 13 | width: imageData.width, 14 | height: imageData.height, 15 | orientation: imageData.orientation, 16 | }, 17 | timestamp: parseInt(imageData.timestamp) 18 | }, 19 | }; 20 | }), 21 | }; 22 | } 23 | 24 | export default { 25 | getPhotos: (fetchParams, onSuccess) => { 26 | if(fetchParams.after) { 27 | fetchParams.after = fetchParams.after.replace(ANDROID_FILE_PREFIX, ''); 28 | } 29 | if(onSuccess && typeof onSuccess === 'function') { 30 | CameraRollAndroid.getCameraImages(fetchParams, (imageDataList) => { 31 | onSuccess(formatToIosCameraRollFormat(imageDataList)); 32 | }); 33 | } else { 34 | return new Promise((resolve, reject) => { 35 | CameraRollAndroid.getCameraImages(fetchParams, (imageDataList) => { 36 | resolve(formatToIosCameraRollFormat(imageDataList)); 37 | }); 38 | }); 39 | } 40 | }, 41 | }; 42 | -------------------------------------------------------------------------------- /index.ios.js: -------------------------------------------------------------------------------- 1 | import { CameraRoll } from 'react-native'; 2 | export default CameraRoll; 3 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "rn-camera-roll", 3 | "version": "0.0.5", 4 | "description": "Camera Roll for react native Android", 5 | "repository": { 6 | "type": "git", 7 | "url": "git+https://github.com/bamlab/rn-camera-roll.git" 8 | }, 9 | "keywords": [ 10 | "react-native", 11 | "react", 12 | "android", 13 | "camera", 14 | "camera-roll" 15 | ], 16 | "peerDependencies": { 17 | "react-native": ">=v0.14.2" 18 | }, 19 | "author": "Almouro (http://bamlab.fr)", 20 | "license": "MIT", 21 | "bugs": { 22 | "url": "https://github.com/bamlab/rn-camera-roll/issues" 23 | }, 24 | "homepage": "https://github.com/bamlab/rn-camera-roll#readme" 25 | } 26 | --------------------------------------------------------------------------------