├── .flowconfig ├── .gitignore ├── LICENSE ├── README.md ├── android ├── build.gradle └── src │ └── main │ ├── AndroidManifest.xml │ └── java │ └── fr │ └── greweb │ └── rnwebglviewshot │ ├── RNWebGLTextureView.java │ ├── RNWebGLTextureViewLoader.java │ ├── RNWebGLTextureViewUIBlock.java │ └── RNWebGLViewShotPackage.java ├── example ├── .babelrc ├── .flowconfig ├── .gitignore ├── .watchmanconfig ├── App.js ├── README.md ├── android │ ├── app │ │ ├── BUCK │ │ ├── build.gradle │ │ ├── proguard-rules.pro │ │ └── src │ │ │ └── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── java │ │ │ └── com │ │ │ │ └── example │ │ │ │ ├── MainActivity.java │ │ │ │ └── MainApplication.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 │ ├── keystores │ │ ├── BUCK │ │ └── debug.keystore.properties │ └── settings.gradle ├── index.android.js ├── index.ios.js ├── ios │ ├── example-tvOS │ │ └── Info.plist │ ├── example-tvOSTests │ │ └── Info.plist │ ├── example.xcodeproj │ │ ├── project.pbxproj │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ ├── example-tvOS.xcscheme │ │ │ └── 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 └── yarn.lock ├── ios ├── RNWebGLTextureView.h ├── RNWebGLTextureView.m ├── RNWebGLTextureViewLoader.h ├── RNWebGLTextureViewLoader.m └── RNWebGLViewShot.xcodeproj │ └── project.pbxproj ├── package.json └── src └── index.js /.flowconfig: -------------------------------------------------------------------------------- 1 | [ignore] 2 | 3 | # We fork some components by platform. 4 | .*/*[.]android.js 5 | 6 | # Ignore templates with `@flow` in header 7 | .*/local-cli/generator.* 8 | 9 | # Ignore malformed json 10 | .*/node_modules/y18n/test/.*\.json 11 | 12 | # Ignore unexpected extra @providesModule 13 | .*/node_modules/commoner/test/source/widget/share.js 14 | 15 | # Ignore duplicate module providers 16 | # For RN Apps installed via npm, "Libraries" folder is inside node_modules/react-native but in the source repo it is in the root 17 | .*/Libraries/react-native/React.js 18 | .*/Libraries/react-native/ReactNative.js 19 | .*/node_modules/jest-runtime/build/__tests__/.* 20 | 21 | [include] 22 | 23 | [libs] 24 | node_modules/react-native/Libraries/react-native/react-native-interface.js 25 | node_modules/react-native/flow 26 | flow/ 27 | 28 | [options] 29 | module.system=haste 30 | 31 | esproposal.class_static_fields=enable 32 | esproposal.class_instance_fields=enable 33 | 34 | experimental.strict_type_args=true 35 | 36 | munge_underscores=true 37 | 38 | module.name_mapper='^image![a-zA-Z0-9$_-]+$' -> 'GlobalImageStub' 39 | module.name_mapper='^[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> 'RelativeImageStub' 40 | 41 | suppress_type=$FlowIssue 42 | suppress_type=$FlowFixMe 43 | suppress_type=$FixMe 44 | 45 | suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(3[0-2]\\|[1-2][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\) 46 | suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(3[0-2]\\|1[0-9]\\|[1-2][0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+ 47 | suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy 48 | 49 | unsafe.enable_getters_and_setters=true 50 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # OSX 2 | # 3 | .DS_Store 4 | 5 | # Xcode 6 | # 7 | build/ 8 | *.pbxuser 9 | !default.pbxuser 10 | *.mode1v3 11 | !default.mode1v3 12 | *.mode2v3 13 | !default.mode2v3 14 | *.perspectivev3 15 | !default.perspectivev3 16 | xcuserdata 17 | *.xccheckout 18 | *.moved-aside 19 | DerivedData 20 | *.hmap 21 | *.ipa 22 | *.xcuserstate 23 | project.xcworkspace 24 | 25 | # node.js 26 | # 27 | node_modules/ 28 | npm-debug.log 29 | 30 | # android 31 | # 32 | android/build/ 33 | android/.gradle/ 34 | android/.idea/ 35 | android/android.iml 36 | android/gradle/ 37 | android/gradlew 38 | android/gradlew.bat 39 | android/local.properties 40 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2017 Gaëtan Renaudeau 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 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | # react-native-webgl-view-shot ![](https://img.shields.io/npm/v/react-native-webgl-view-shot.svg) 3 | 4 | React Native WebGL extension to rasterize a view as a GL Texture. The library extends the [Texture Config Formats of `react-native-webgl`](https://github.com/react-community/react-native-webgl#texture-config-formats) to add `{ view }` config. 5 | 6 | **[Example](example/App.js)** 7 | 8 | ![u](https://user-images.githubusercontent.com/211411/29744347-9d39247a-8aa3-11e7-8f2a-040979a55d9f.gif) 9 | 10 | 11 | ## Install 12 | 13 | ```bash 14 | yarn add react-native-webgl-view-shot 15 | react-native link react-native-webgl-view-shot 16 | ``` 17 | 18 | ## Usage 19 | 20 | ```js 21 | import WebGLViewShot from "react-native-webgl-view-shot"; 22 | 23 | // render this somewhere... 24 | 25 | 26 | ...something to rasterize 27 | 28 | 29 | // then you can give the ref to react-native-webgl's loadConfig: 30 | 31 | gl.getExtension("RN").loadConfig({ 32 | view: this.refs.shotRef 33 | }).then(({ texture }) => { 34 | // texture hold the rasterize image of the view, shoot at the time you called loadConfig 35 | }); 36 | 37 | // But you can also enable continuous rasterization: 38 | 39 | gl.getExtension("RN").loadConfig({ 40 | view: this.refs.shotRef, 41 | continuous: true 42 | }).then(({ texture }) => { 43 | // the texture will continuously be in sync with the View content (NB beware of some delay) 44 | // ... use texture like a normal WebGLTexture 45 | }); 46 | ``` 47 | 48 | There are 3 cases the view continuous rasterization should stop: 49 | 50 | - the view was unmounted. 51 | - `unloadConfig(texture)` was called. 52 | - WebGLView was unmounted. 53 | 54 | ### Supported views 55 | 56 | The list of supported / rasterizable content is the same as listed in the library [react-native-view-shot](https://github.com/gre/react-native-view-shot#interoperability-table) (even though that library is not directly used at the moment, some native code was taken from it). 57 | 58 | ### Advanced notes 59 | 60 | It is technically possible to just pass-in a View ref without using the `WebGLViewShot` component. However be aware of two things: (1) you still need to `import "react-native-webgl-view-shot"` so the format is extended, (2) you might need to use a wrapping `` for the capture to work out. 61 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | repositories { 3 | jcenter() 4 | } 5 | 6 | dependencies { 7 | classpath 'com.android.tools.build:gradle:2.3.0' 8 | } 9 | } 10 | 11 | apply plugin: 'com.android.library' 12 | 13 | android { 14 | compileSdkVersion 26 15 | buildToolsVersion "26.0.1" 16 | 17 | defaultConfig { 18 | minSdkVersion 16 19 | targetSdkVersion 26 20 | versionCode 1 21 | versionName "1.0" 22 | } 23 | lintOptions { 24 | abortOnError false 25 | } 26 | } 27 | 28 | allprojects { 29 | repositories { 30 | mavenLocal() 31 | jcenter() 32 | maven { 33 | // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm 34 | url "$rootDir/../node_modules/react-native/android" 35 | } 36 | } 37 | } 38 | 39 | dependencies { 40 | compile 'com.facebook.react:react-native:+' 41 | } -------------------------------------------------------------------------------- /android/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /android/src/main/java/fr/greweb/rnwebglviewshot/RNWebGLTextureView.java: -------------------------------------------------------------------------------- 1 | package fr.greweb.rnwebglviewshot; 2 | 3 | import javax.annotation.Nullable; 4 | 5 | import android.app.Activity; 6 | import android.content.Intent; 7 | import android.graphics.Bitmap; 8 | import android.graphics.Canvas; 9 | import android.graphics.Matrix; 10 | import android.net.Uri; 11 | import android.opengl.GLUtils; 12 | import android.util.Base64; 13 | import android.view.TextureView; 14 | import android.view.View; 15 | import android.view.ViewGroup; 16 | import android.view.ViewTreeObserver; 17 | import android.widget.ScrollView; 18 | 19 | import com.facebook.react.bridge.Promise; 20 | import com.facebook.react.bridge.ReactApplicationContext; 21 | import com.facebook.react.bridge.ReadableMap; 22 | import com.facebook.react.uimanager.NativeViewHierarchyManager; 23 | import com.facebook.react.uimanager.UIBlock; 24 | 25 | import java.io.ByteArrayOutputStream; 26 | import java.io.File; 27 | import java.io.FileOutputStream; 28 | import java.io.IOException; 29 | import java.io.OutputStream; 30 | import java.util.ArrayList; 31 | import java.util.List; 32 | 33 | import fr.greweb.rnwebgl.RNWebGLTexture; 34 | 35 | import static android.opengl.GLES20.GL_LINEAR; 36 | import static android.opengl.GLES20.GL_TEXTURE_2D; 37 | import static android.opengl.GLES20.GL_TEXTURE_MAG_FILTER; 38 | import static android.opengl.GLES20.GL_TEXTURE_MIN_FILTER; 39 | import static android.opengl.GLES20.glBindTexture; 40 | import static android.opengl.GLES20.glGenTextures; 41 | import static android.opengl.GLES20.glTexParameteri; 42 | 43 | /** 44 | * Snapshot utility class allow to screenshot a view. 45 | */ 46 | public class RNWebGLTextureView extends RNWebGLTexture implements Runnable, ViewTreeObserver.OnDrawListener { 47 | 48 | final View view; 49 | final ViewTreeObserver viewTreeObserver; 50 | final boolean yflip; 51 | 52 | public RNWebGLTextureView(ReadableMap config, View view) { 53 | super(config, view.getWidth(), view.getHeight()); 54 | boolean continuous = config.hasKey("continuous") && config.getBoolean("continuous"); 55 | yflip = config.hasKey("yflip") && config.getBoolean("yflip"); 56 | this.view = view; 57 | if (continuous) { 58 | viewTreeObserver = view.getViewTreeObserver(); 59 | viewTreeObserver.addOnDrawListener(this); 60 | } 61 | else { 62 | viewTreeObserver = null; 63 | } 64 | this.runOnGLThread(this); 65 | } 66 | 67 | @Override 68 | public void onDraw() { 69 | this.runOnGLThread(this); 70 | } 71 | 72 | @Override 73 | public void destroy() { 74 | if (viewTreeObserver != null) { 75 | viewTreeObserver.removeOnDrawListener(this); 76 | } 77 | super.destroy(); 78 | } 79 | 80 | public void run() { 81 | Bitmap bitmap; 82 | try { 83 | bitmap = captureView(view); 84 | } 85 | catch (Exception e) { 86 | return; 87 | } 88 | if (yflip) { 89 | Matrix matrix = new Matrix(); 90 | matrix.postScale(1, -1); 91 | boolean hasAlpha = bitmap.hasAlpha(); 92 | bitmap = Bitmap.createBitmap(bitmap, 0, 0, bitmap.getWidth(), bitmap.getHeight(), matrix, true); 93 | bitmap.setHasAlpha(hasAlpha); 94 | } 95 | int[] textures = new int[1]; 96 | glGenTextures(1, textures, 0); 97 | glBindTexture(GL_TEXTURE_2D, textures[0]); 98 | glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); 99 | glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); 100 | GLUtils.texImage2D(GL_TEXTURE_2D, 0, bitmap, 0); 101 | this.attachTexture(textures[0]); 102 | } 103 | 104 | // Code from react-native-view-shot 105 | 106 | private List getAllChildren(View v) { 107 | if (!(v instanceof ViewGroup)) { 108 | ArrayList viewArrayList = new ArrayList(); 109 | viewArrayList.add(v); 110 | return viewArrayList; 111 | } 112 | ArrayList result = new ArrayList(); 113 | ViewGroup viewGroup = (ViewGroup) v; 114 | for (int i = 0; i < viewGroup.getChildCount(); i++) { 115 | View child = viewGroup.getChildAt(i); 116 | result.addAll(getAllChildren(child)); 117 | } 118 | return result; 119 | } 120 | 121 | private Bitmap captureView (View view) { 122 | int w = view.getWidth(); 123 | int h = view.getHeight(); 124 | if (w <= 0 || h <= 0) { 125 | throw new RuntimeException("Impossible to snapshot the view: view is invalid"); 126 | } 127 | 128 | Bitmap bitmap = Bitmap.createBitmap(w, h, Bitmap.Config.ARGB_8888); 129 | Bitmap childBitmapBuffer; 130 | Canvas c = new Canvas(bitmap); 131 | view.draw(c); 132 | List childrenList = getAllChildren(view); 133 | for (View child : childrenList) { 134 | if(child instanceof TextureView) { 135 | ((TextureView) child).setOpaque(false); 136 | childBitmapBuffer = ((TextureView) child).getBitmap(child.getWidth(), child.getHeight()); 137 | c.drawBitmap(childBitmapBuffer, child.getLeft() + ((ViewGroup)child.getParent()).getLeft() + child.getPaddingLeft(), child.getTop() + ((ViewGroup)child.getParent()).getTop() + child.getPaddingTop(), null); 138 | } 139 | } 140 | if (bitmap == null) { 141 | throw new RuntimeException("Impossible to snapshot the view"); 142 | } 143 | return bitmap; 144 | } 145 | } 146 | -------------------------------------------------------------------------------- /android/src/main/java/fr/greweb/rnwebglviewshot/RNWebGLTextureViewLoader.java: -------------------------------------------------------------------------------- 1 | 2 | package fr.greweb.rnwebglviewshot; 3 | 4 | import fr.greweb.rnwebgl.RNWebGLTextureCompletionBlock; 5 | import fr.greweb.rnwebgl.RNWebGLTextureConfigLoader; 6 | import com.facebook.react.bridge.ReactApplicationContext; 7 | import com.facebook.react.bridge.ReactContextBaseJavaModule; 8 | import com.facebook.react.bridge.ReadableMap; 9 | import com.facebook.react.uimanager.UIManagerModule; 10 | 11 | public class RNWebGLTextureViewLoader extends ReactContextBaseJavaModule implements RNWebGLTextureConfigLoader { 12 | 13 | private final ReactApplicationContext reactContext; 14 | 15 | public RNWebGLTextureViewLoader(ReactApplicationContext reactContext) { 16 | super(reactContext); 17 | this.reactContext = reactContext; 18 | } 19 | 20 | @Override 21 | public boolean canLoadConfig(ReadableMap config) { 22 | return config.hasKey("view"); 23 | } 24 | 25 | @Override 26 | public void loadWithConfig(ReadableMap config, RNWebGLTextureCompletionBlock callback) { 27 | int tag = config.getInt("view"); 28 | try { 29 | UIManagerModule uiManager = this.reactContext.getNativeModule(UIManagerModule.class); 30 | uiManager.addUIBlock(new RNWebGLTextureViewUIBlock(config, tag, callback)); 31 | } 32 | catch (Exception e) { 33 | callback.call(e, null); 34 | } 35 | } 36 | 37 | @Override 38 | public String getName() { 39 | return "RNWebGLTextureViewLoader"; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /android/src/main/java/fr/greweb/rnwebglviewshot/RNWebGLTextureViewUIBlock.java: -------------------------------------------------------------------------------- 1 | package fr.greweb.rnwebglviewshot; 2 | 3 | import android.view.View; 4 | 5 | import com.facebook.react.bridge.ReactApplicationContext; 6 | import com.facebook.react.bridge.ReadableMap; 7 | import com.facebook.react.uimanager.NativeViewHierarchyManager; 8 | import com.facebook.react.uimanager.UIBlock; 9 | import fr.greweb.rnwebgl.RNWebGLTextureCompletionBlock; 10 | 11 | public class RNWebGLTextureViewUIBlock implements UIBlock { 12 | private int tag; 13 | private ReadableMap config; 14 | private RNWebGLTextureCompletionBlock callback; 15 | 16 | public RNWebGLTextureViewUIBlock(ReadableMap config, int tag, RNWebGLTextureCompletionBlock callback) { 17 | this.config = config; 18 | this.tag = tag; 19 | this.callback = callback; 20 | } 21 | 22 | @Override 23 | public void execute(NativeViewHierarchyManager nativeViewHierarchyManager) { 24 | View view = nativeViewHierarchyManager.resolveView(tag); 25 | if (view == null) { 26 | callback.call(new Exception("No view found with reactTag: " + tag), null); 27 | return; 28 | } 29 | callback.call(null, new RNWebGLTextureView(config, view)); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /android/src/main/java/fr/greweb/rnwebglviewshot/RNWebGLViewShotPackage.java: -------------------------------------------------------------------------------- 1 | 2 | package fr.greweb.rnwebglviewshot; 3 | 4 | import java.util.Arrays; 5 | import java.util.Collections; 6 | import java.util.List; 7 | 8 | import com.facebook.react.ReactPackage; 9 | import com.facebook.react.bridge.NativeModule; 10 | import com.facebook.react.bridge.ReactApplicationContext; 11 | import com.facebook.react.uimanager.ViewManager; 12 | import com.facebook.react.bridge.JavaScriptModule; 13 | public class RNWebGLViewShotPackage implements ReactPackage { 14 | @Override 15 | public List createNativeModules(ReactApplicationContext reactContext) { 16 | return Arrays.asList(new RNWebGLTextureViewLoader(reactContext)); 17 | } 18 | 19 | // Deprecated RN 0.47 20 | // @Override 21 | public List> createJSModules() { 22 | return Collections.emptyList(); 23 | } 24 | 25 | @Override 26 | public List createViewManagers(ReactApplicationContext reactContext) { 27 | return Collections.emptyList(); 28 | } 29 | } -------------------------------------------------------------------------------- /example/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | "babel-preset-react-native-stage-0/decorator-support" 4 | ], 5 | "env": { 6 | "development": { 7 | "plugins": [ 8 | "transform-react-jsx-source" 9 | ] 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /example/.flowconfig: -------------------------------------------------------------------------------- 1 | [ignore] 2 | ; We fork some components by platform 3 | .*/*[.]android.js 4 | 5 | ; Ignore "BUCK" generated dirs 6 | /\.buckd/ 7 | 8 | ; Ignore unexpected extra "@providesModule" 9 | .*/node_modules/.*/node_modules/fbjs/.* 10 | 11 | ; Ignore duplicate module providers 12 | ; For RN Apps installed via npm, "Libraries" folder is inside 13 | ; "node_modules/react-native" but in the source repo it is in the root 14 | .*/Libraries/react-native/React.js 15 | .*/Libraries/react-native/ReactNative.js 16 | 17 | ; Additional create-react-native-app ignores 18 | 19 | ; Ignore duplicate module providers 20 | .*/node_modules/fbemitter/lib/* 21 | 22 | ; Ignore misbehaving dev-dependencies 23 | .*/node_modules/xdl/build/* 24 | .*/node_modules/reqwest/tests/* 25 | 26 | ; Ignore missing expo-sdk dependencies (temporarily) 27 | ; https://github.com/expo/expo/issues/162 28 | .*/node_modules/expo/src/* 29 | 30 | ; Ignore react-native-fbads dependency of the expo sdk 31 | .*/node_modules/react-native-fbads/* 32 | 33 | [include] 34 | 35 | [libs] 36 | node_modules/react-native/Libraries/react-native/react-native-interface.js 37 | node_modules/react-native/flow 38 | flow/ 39 | 40 | [options] 41 | module.system=haste 42 | 43 | emoji=true 44 | 45 | experimental.strict_type_args=true 46 | 47 | munge_underscores=true 48 | 49 | module.name_mapper='^[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> 'RelativeImageStub' 50 | 51 | suppress_type=$FlowIssue 52 | suppress_type=$FlowFixMe 53 | suppress_type=$FixMe 54 | 55 | suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(4[0-9]\\|[1-3][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\) 56 | suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(4[0-9]\\|[1-3][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+ 57 | suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy 58 | suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError 59 | 60 | unsafe.enable_getters_and_setters=true 61 | 62 | [version] 63 | ^0.49.1 64 | -------------------------------------------------------------------------------- /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/IntelliJ 26 | # 27 | build/ 28 | .idea 29 | .gradle 30 | local.properties 31 | *.iml 32 | 33 | # node.js 34 | # 35 | node_modules/ 36 | npm-debug.log 37 | 38 | # BUCK 39 | buck-out/ 40 | \.buckd/ 41 | android/app/libs 42 | *.keystore 43 | 44 | # fastlane 45 | # 46 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 47 | # screenshots whenever they are needed. 48 | # For more information about the recommended setup visit: 49 | # https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md 50 | 51 | fastlane/report.xml 52 | fastlane/Preview.html 53 | fastlane/screenshots 54 | -------------------------------------------------------------------------------- /example/.watchmanconfig: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /example/App.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from "react"; 2 | import { StyleSheet, Text, ScrollView, TextInput } from "react-native"; 3 | import { WebGLView } from "react-native-webgl"; 4 | import WebGLViewShot from "react-native-webgl-view-shot"; 5 | 6 | export default class App extends Component { 7 | state = { 8 | text: "Hello World" 9 | }; 10 | _raf: *; 11 | 12 | onChangeText = text => this.setState({ text }); 13 | 14 | onContextCreate = (gl: WebGLRenderingContext) => { 15 | const rngl = gl.getExtension("RN"); 16 | 17 | gl.viewport(0, 0, gl.drawingBufferWidth, gl.drawingBufferHeight); 18 | const buffer = gl.createBuffer(); 19 | gl.bindBuffer(gl.ARRAY_BUFFER, buffer); 20 | gl.bufferData( 21 | gl.ARRAY_BUFFER, 22 | new Float32Array([-1, -1, -1, 4, 4, -1]), 23 | gl.STATIC_DRAW 24 | ); 25 | const vertexShader = gl.createShader(gl.VERTEX_SHADER); 26 | gl.shaderSource( 27 | vertexShader, 28 | `\ 29 | attribute vec2 p; 30 | varying vec2 uv; 31 | void main() { 32 | gl_Position = vec4(p,0.0,1.0); 33 | uv = 0.5 * (p+1.0); 34 | }` 35 | ); 36 | gl.compileShader(vertexShader); 37 | const fragmentShader = gl.createShader(gl.FRAGMENT_SHADER); 38 | gl.shaderSource( 39 | fragmentShader, 40 | `\ 41 | precision highp float; 42 | varying vec2 uv; 43 | uniform sampler2D t; 44 | uniform float time; 45 | void main() { 46 | gl_FragColor = texture2D(t, uv + vec2( 47 | 0.03 * cos(0.5 * time + 20.0 * uv.x), 48 | 0.03 * sin(0.5 * time + 20.0 * uv.y) 49 | )) + vec4( 50 | sin(3.0 * time + uv.x), 51 | cos(time + 0.5 * uv.y), 52 | 0.2 * cos(2.0 * time - uv.x * uv.y), 53 | 0.0 54 | ); 55 | }` 56 | ); 57 | 58 | gl.compileShader(fragmentShader); 59 | var program = gl.createProgram(); 60 | gl.attachShader(program, vertexShader); 61 | gl.attachShader(program, fragmentShader); 62 | gl.linkProgram(program); 63 | gl.useProgram(program); 64 | var p = gl.getAttribLocation(program, "p"); 65 | gl.enableVertexAttribArray(p); 66 | gl.vertexAttribPointer(p, 2, gl.FLOAT, false, 0, 0); 67 | const tLocation = gl.getUniformLocation(program, "t"); 68 | const timeLocation = gl.getUniformLocation(program, "time"); 69 | rngl 70 | .loadTexture({ 71 | view: this.refs.viewShot, 72 | continuous: true, 73 | yflip: true 74 | }) 75 | .then(({ texture }) => { 76 | gl.activeTexture(gl.TEXTURE0); 77 | gl.bindTexture(gl.TEXTURE_2D, texture); 78 | gl.uniform1i(tLocation, 0); 79 | 80 | let startTime; 81 | const loop = (time: number) => { 82 | if (!startTime) startTime = time; 83 | this._raf = requestAnimationFrame(loop); 84 | gl.uniform1f(timeLocation, (time - startTime) / 1000); 85 | gl.drawArrays(gl.TRIANGLES, 0, 3); 86 | gl.flush(); 87 | rngl.endFrame(); 88 | }; 89 | this._raf = requestAnimationFrame(loop); 90 | }); 91 | }; 92 | 93 | componentWillUnmount() { 94 | cancelAnimationFrame(this._raf); 95 | } 96 | 97 | render() { 98 | const { text } = this.state; 99 | return ( 100 | 101 | 106 | 110 | 111 | 112 | {text} 113 | 114 | 115 | 116 | ); 117 | } 118 | } 119 | 120 | const styles = StyleSheet.create({ 121 | root: { 122 | flex: 1, 123 | backgroundColor: "#f6f6f6" 124 | }, 125 | container: { 126 | paddingVertical: 20, 127 | backgroundColor: "#f6f6f6" 128 | }, 129 | input: { 130 | height: 40, 131 | borderColor: "gray", 132 | borderWidth: 1 133 | }, 134 | glView: { 135 | width: 300, 136 | height: 200 137 | }, 138 | shot: { 139 | width: 300, 140 | height: 200, 141 | alignItems: "center", 142 | justifyContent: "center", 143 | backgroundColor: "black" 144 | }, 145 | text: { 146 | fontWeight: "bold", 147 | fontSize: 40, 148 | color: "white" 149 | } 150 | }); 151 | -------------------------------------------------------------------------------- /example/README.md: -------------------------------------------------------------------------------- 1 | This project was bootstrapped with [Create React Native App](https://github.com/react-community/create-react-native-app). 2 | 3 | Below you'll find information about performing common tasks. The most recent version of this guide is available [here](https://github.com/react-community/create-react-native-app/blob/master/react-native-scripts/template/README.md). 4 | 5 | ## Table of Contents 6 | 7 | * [Updating to New Releases](#updating-to-new-releases) 8 | * [Available Scripts](#available-scripts) 9 | * [npm start](#npm-start) 10 | * [npm test](#npm-test) 11 | * [npm run ios](#npm-run-ios) 12 | * [npm run android](#npm-run-android) 13 | * [npm run eject](#npm-run-eject) 14 | * [Writing and Running Tests](#writing-and-running-tests) 15 | * [Environment Variables](#environment-variables) 16 | * [Configuring Packager IP Address](#configuring-packager-ip-address) 17 | * [Adding Flow](#adding-flow) 18 | * [Customizing App Display Name and Icon](#customizing-app-display-name-and-icon) 19 | * [Sharing and Deployment](#sharing-and-deployment) 20 | * [Publishing to Expo's React Native Community](#publishing-to-expos-react-native-community) 21 | * [Building an Expo "standalone" app](#building-an-expo-standalone-app) 22 | * [Ejecting from Create React Native App](#ejecting-from-create-react-native-app) 23 | * [Build Dependencies (Xcode & Android Studio)](#build-dependencies-xcode-android-studio) 24 | * [Should I Use ExpoKit?](#should-i-use-expokit) 25 | * [Troubleshooting](#troubleshooting) 26 | * [Networking](#networking) 27 | * [iOS Simulator won't open](#ios-simulator-wont-open) 28 | * [QR Code does not scan](#qr-code-does-not-scan) 29 | 30 | ## Updating to New Releases 31 | 32 | You should only need to update the global installation of `create-react-native-app` very rarely, ideally never. 33 | 34 | Updating the `react-native-scripts` dependency of your app should be as simple as bumping the version number in `package.json` and reinstalling your project's dependencies. 35 | 36 | Upgrading to a new version of React Native requires updating the `react-native`, `react`, and `expo` package versions, and setting the correct `sdkVersion` in `app.json`. See the [versioning guide](https://github.com/react-community/create-react-native-app/blob/master/VERSIONS.md) for up-to-date information about package version compatibility. 37 | 38 | ## Available Scripts 39 | 40 | If Yarn was installed when the project was initialized, then dependencies will have been installed via Yarn, and you should probably use it to run these commands as well. Unlike dependency installation, command running syntax is identical for Yarn and NPM at the time of this writing. 41 | 42 | ### `npm start` 43 | 44 | Runs your app in development mode. 45 | 46 | Open it in the [Expo app](https://expo.io) on your phone to view it. It will reload if you save edits to your files, and you will see build errors and logs in the terminal. 47 | 48 | Sometimes you may need to reset or clear the React Native packager's cache. To do so, you can pass the `--reset-cache` flag to the start script: 49 | 50 | ``` 51 | npm start -- --reset-cache 52 | # or 53 | yarn start -- --reset-cache 54 | ``` 55 | 56 | #### `npm test` 57 | 58 | Runs the [jest](https://github.com/facebook/jest) test runner on your tests. 59 | 60 | #### `npm run ios` 61 | 62 | Like `npm start`, but also attempts to open your app in the iOS Simulator if you're on a Mac and have it installed. 63 | 64 | #### `npm run android` 65 | 66 | Like `npm start`, but also attempts to open your app on a connected Android device or emulator. Requires an installation of Android build tools (see [React Native docs](https://facebook.github.io/react-native/docs/getting-started.html) for detailed setup). We also recommend installing Genymotion as your Android emulator. Once you've finished setting up the native build environment, there are two options for making the right copy of `adb` available to Create React Native App: 67 | 68 | ##### Using Android Studio's `adb` 69 | 70 | 1. Make sure that you can run adb from your terminal. 71 | 2. Open Genymotion and navigate to `Settings -> ADB`. Select “Use custom Android SDK tools” and update with your [Android SDK directory](https://stackoverflow.com/questions/25176594/android-sdk-location). 72 | 73 | ##### Using Genymotion's `adb` 74 | 75 | 1. Find Genymotion’s copy of adb. On macOS for example, this is normally `/Applications/Genymotion.app/Contents/MacOS/tools/`. 76 | 2. Add the Genymotion tools directory to your path (instructions for [Mac](http://osxdaily.com/2014/08/14/add-new-path-to-path-command-line/), [Linux](http://www.computerhope.com/issues/ch001647.htm), and [Windows](https://www.howtogeek.com/118594/how-to-edit-your-system-path-for-easy-command-line-access/)). 77 | 3. Make sure that you can run adb from your terminal. 78 | 79 | #### `npm run eject` 80 | 81 | This will start the process of "ejecting" from Create React Native App's build scripts. You'll be asked a couple of questions about how you'd like to build your project. 82 | 83 | **Warning:** Running eject is a permanent action (aside from whatever version control system you use). An ejected app will require you to have an [Xcode and/or Android Studio environment](https://facebook.github.io/react-native/docs/getting-started.html) set up. 84 | 85 | ## Customizing App Display Name and Icon 86 | 87 | You can edit `app.json` to include [configuration keys](https://docs.expo.io/versions/latest/guides/configuration.html) under the `expo` key. 88 | 89 | To change your app's display name, set the `expo.name` key in `app.json` to an appropriate string. 90 | 91 | To set an app icon, set the `expo.icon` key in `app.json` to be either a local path or a URL. It's recommended that you use a 512x512 png file with transparency. 92 | 93 | ## Writing and Running Tests 94 | 95 | This project is set up to use [jest](https://facebook.github.io/jest/) for tests. You can configure whatever testing strategy you like, but jest works out of the box. Create test files in directories called `__tests__` or with the `.test` extension to have the files loaded by jest. See the [the template project](https://github.com/react-community/create-react-native-app/blob/master/react-native-scripts/template/App.test.js) for an example test. The [jest documentation](https://facebook.github.io/jest/docs/getting-started.html) is also a wonderful resource, as is the [React Native testing tutorial](https://facebook.github.io/jest/docs/tutorial-react-native.html). 96 | 97 | ## Environment Variables 98 | 99 | You can configure some of Create React Native App's behavior using environment variables. 100 | 101 | ### Configuring Packager IP Address 102 | 103 | When starting your project, you'll see something like this for your project URL: 104 | 105 | ``` 106 | exp://192.168.0.2:19000 107 | ``` 108 | 109 | The "manifest" at that URL tells the Expo app how to retrieve and load your app's JavaScript bundle, so even if you load it in the app via a URL like `exp://localhost:19000`, the Expo client app will still try to retrieve your app at the IP address that the start script provides. 110 | 111 | In some cases, this is less than ideal. This might be the case if you need to run your project inside of a virtual machine and you have to access the packager via a different IP address than the one which prints by default. In order to override the IP address or hostname that is detected by Create React Native App, you can specify your own hostname via the `REACT_NATIVE_PACKAGER_HOSTNAME` environment variable: 112 | 113 | Mac and Linux: 114 | 115 | ``` 116 | REACT_NATIVE_PACKAGER_HOSTNAME='my-custom-ip-address-or-hostname' npm start 117 | ``` 118 | 119 | Windows: 120 | ``` 121 | set REACT_NATIVE_PACKAGER_HOSTNAME='my-custom-ip-address-or-hostname' 122 | npm start 123 | ``` 124 | 125 | The above example would cause the development server to listen on `exp://my-custom-ip-address-or-hostname:19000`. 126 | 127 | ## Adding Flow 128 | 129 | Flow is a static type checker that helps you write code with fewer bugs. Check out this [introduction to using static types in JavaScript](https://medium.com/@preethikasireddy/why-use-static-types-in-javascript-part-1-8382da1e0adb) if you are new to this concept. 130 | 131 | React Native works with [Flow](http://flowtype.org/) out of the box, as long as your Flow version matches the one used in the version of React Native. 132 | 133 | To add a local dependency to the correct Flow version to a Create React Native App project, follow these steps: 134 | 135 | 1. Find the Flow `[version]` at the bottom of the included [.flowconfig](.flowconfig) 136 | 2. Run `npm install --save-dev flow-bin@x.y.z` (or `yarn add --dev flow-bin@x.y.z`), where `x.y.z` is the .flowconfig version number. 137 | 3. Add `"flow": "flow"` to the `scripts` section of your `package.json`. 138 | 4. Add `// @flow` to any files you want to type check (for example, to `App.js`). 139 | 140 | Now you can run `npm run flow` (or `yarn flow`) to check the files for type errors. 141 | You can optionally use a [plugin for your IDE or editor](https://flow.org/en/docs/editors/) for a better integrated experience. 142 | 143 | To learn more about Flow, check out [its documentation](https://flow.org/). 144 | 145 | ## Sharing and Deployment 146 | 147 | Create React Native App does a lot of work to make app setup and development simple and straightforward, but it's very difficult to do the same for deploying to Apple's App Store or Google's Play Store without relying on a hosted service. 148 | 149 | ### Publishing to Expo's React Native Community 150 | 151 | Expo provides free hosting for the JS-only apps created by CRNA, allowing you to share your app through the Expo client app. This requires registration for an Expo account. 152 | 153 | Install the `exp` command-line tool, and run the publish command: 154 | 155 | ``` 156 | $ npm i -g exp 157 | $ exp publish 158 | ``` 159 | 160 | ### Building an Expo "standalone" app 161 | 162 | You can also use a service like [Expo's standalone builds](https://docs.expo.io/versions/latest/guides/building-standalone-apps.html) if you want to get an IPA/APK for distribution without having to build the native code yourself. 163 | 164 | ### Ejecting from Create React Native App 165 | 166 | If you want to build and deploy your app yourself, you'll need to eject from CRNA and use Xcode and Android Studio. 167 | 168 | This is usually as simple as running `npm run eject` in your project, which will walk you through the process. Make sure to install `react-native-cli` and follow the [native code getting started guide for React Native](https://facebook.github.io/react-native/docs/getting-started.html). 169 | 170 | #### Should I Use ExpoKit? 171 | 172 | If you have made use of Expo APIs while working on your project, then those API calls will stop working if you eject to a regular React Native project. If you want to continue using those APIs, you can eject to "React Native + ExpoKit" which will still allow you to build your own native code and continue using the Expo APIs. See the [ejecting guide](https://github.com/react-community/create-react-native-app/blob/master/EJECTING.md) for more details about this option. 173 | 174 | ## Troubleshooting 175 | 176 | ### Networking 177 | 178 | If you're unable to load your app on your phone due to a network timeout or a refused connection, a good first step is to verify that your phone and computer are on the same network and that they can reach each other. Create React Native App needs access to ports 19000 and 19001 so ensure that your network and firewall settings allow access from your device to your computer on both of these ports. 179 | 180 | Try opening a web browser on your phone and opening the URL that the packager script prints, replacing `exp://` with `http://`. So, for example, if underneath the QR code in your terminal you see: 181 | 182 | ``` 183 | exp://192.168.0.1:19000 184 | ``` 185 | 186 | Try opening Safari or Chrome on your phone and loading 187 | 188 | ``` 189 | http://192.168.0.1:19000 190 | ``` 191 | 192 | and 193 | 194 | ``` 195 | http://192.168.0.1:19001 196 | ``` 197 | 198 | If this works, but you're still unable to load your app by scanning the QR code, please open an issue on the [Create React Native App repository](https://github.com/react-community/create-react-native-app) with details about these steps and any other error messages you may have received. 199 | 200 | If you're not able to load the `http` URL in your phone's web browser, try using the tethering/mobile hotspot feature on your phone (beware of data usage, though), connecting your computer to that WiFi network, and restarting the packager. 201 | 202 | ### iOS Simulator won't open 203 | 204 | If you're on a Mac, there are a few errors that users sometimes see when attempting to `npm run ios`: 205 | 206 | * "non-zero exit code: 107" 207 | * "You may need to install Xcode" but it is already installed 208 | * and others 209 | 210 | There are a few steps you may want to take to troubleshoot these kinds of errors: 211 | 212 | 1. Make sure Xcode is installed and open it to accept the license agreement if it prompts you. You can install it from the Mac App Store. 213 | 2. Open Xcode's Preferences, the Locations tab, and make sure that the `Command Line Tools` menu option is set to something. Sometimes when the CLI tools are first installed by Homebrew this option is left blank, which can prevent Apple utilities from finding the simulator. Make sure to re-run `npm/yarn run ios` after doing so. 214 | 3. If that doesn't work, open the Simulator, and under the app menu select `Reset Contents and Settings...`. After that has finished, quit the Simulator, and re-run `npm/yarn run ios`. 215 | 216 | ### QR Code does not scan 217 | 218 | If you're not able to scan the QR code, make sure your phone's camera is focusing correctly, and also make sure that the contrast on the two colors in your terminal is high enough. For example, WebStorm's default themes may [not have enough contrast](https://github.com/react-community/create-react-native-app/issues/49) for terminal QR codes to be scannable with the system barcode scanners that the Expo app uses. 219 | 220 | If this causes problems for you, you may want to try changing your terminal's color theme to have more contrast, or running Create React Native App from a different terminal. You can also manually enter the URL printed by the packager script in the Expo app's search bar to load it manually. 221 | -------------------------------------------------------------------------------- /example/android/app/BUCK: -------------------------------------------------------------------------------- 1 | # To learn about Buck see [Docs](https://buckbuild.com/). 2 | # To run your application with Buck: 3 | # - install Buck 4 | # - `npm start` - to start the packager 5 | # - `cd android` 6 | # - `keytool -genkey -v -keystore keystores/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname "CN=Android Debug,O=Android,C=US"` 7 | # - `./gradlew :app:copyDownloadableDepsToLibs` - make all Gradle compile dependencies available to Buck 8 | # - `buck install -r android/app` - compile, install and run application 9 | # 10 | 11 | lib_deps = [] 12 | 13 | for jarfile in glob(['libs/*.jar']): 14 | name = 'jars__' + jarfile[jarfile.rindex('/') + 1: jarfile.rindex('.jar')] 15 | lib_deps.append(':' + name) 16 | prebuilt_jar( 17 | name = name, 18 | binary_jar = jarfile, 19 | ) 20 | 21 | for aarfile in glob(['libs/*.aar']): 22 | name = 'aars__' + aarfile[aarfile.rindex('/') + 1: aarfile.rindex('.aar')] 23 | lib_deps.append(':' + name) 24 | android_prebuilt_aar( 25 | name = name, 26 | aar = aarfile, 27 | ) 28 | 29 | android_library( 30 | name = "all-libs", 31 | exported_deps = lib_deps, 32 | ) 33 | 34 | android_library( 35 | name = "app-code", 36 | srcs = glob([ 37 | "src/main/java/**/*.java", 38 | ]), 39 | deps = [ 40 | ":all-libs", 41 | ":build_config", 42 | ":res", 43 | ], 44 | ) 45 | 46 | android_build_config( 47 | name = "build_config", 48 | package = "com.example", 49 | ) 50 | 51 | android_resource( 52 | name = "res", 53 | package = "com.example", 54 | res = "src/main/res", 55 | ) 56 | 57 | android_binary( 58 | name = "app", 59 | keystore = "//android/keystores:debug", 60 | manifest = "src/main/AndroidManifest.xml", 61 | package_type = "debug", 62 | deps = [ 63 | ":app-code", 64 | ], 65 | ) 66 | -------------------------------------------------------------------------------- /example/android/app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: "com.android.application" 2 | 3 | import com.android.build.OutputFile 4 | 5 | /** 6 | * The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets 7 | * and bundleReleaseJsAndAssets). 8 | * These basically call `react-native bundle` with the correct arguments during the Android build 9 | * cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the 10 | * bundle directly from the development server. Below you can see all the possible configurations 11 | * and their defaults. If you decide to add a configuration block, make sure to add it before the 12 | * `apply from: "../../node_modules/react-native/react.gradle"` line. 13 | * 14 | * project.ext.react = [ 15 | * // the name of the generated asset file containing your JS bundle 16 | * bundleAssetName: "index.android.bundle", 17 | * 18 | * // the entry file for bundle generation 19 | * entryFile: "index.android.js", 20 | * 21 | * // whether to bundle JS and assets in debug mode 22 | * bundleInDebug: false, 23 | * 24 | * // whether to bundle JS and assets in release mode 25 | * bundleInRelease: true, 26 | * 27 | * // whether to bundle JS and assets in another build variant (if configured). 28 | * // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants 29 | * // The configuration property can be in the following formats 30 | * // 'bundleIn${productFlavor}${buildType}' 31 | * // 'bundleIn${buildType}' 32 | * // bundleInFreeDebug: true, 33 | * // bundleInPaidRelease: true, 34 | * // bundleInBeta: true, 35 | * 36 | * // whether to disable dev mode in custom build variants (by default only disabled in release) 37 | * // for example: to disable dev mode in the staging build type (if configured) 38 | * devDisabledInStaging: true, 39 | * // The configuration property can be in the following formats 40 | * // 'devDisabledIn${productFlavor}${buildType}' 41 | * // 'devDisabledIn${buildType}' 42 | * 43 | * // the root of your project, i.e. where "package.json" lives 44 | * root: "../../", 45 | * 46 | * // where to put the JS bundle asset in debug mode 47 | * jsBundleDirDebug: "$buildDir/intermediates/assets/debug", 48 | * 49 | * // where to put the JS bundle asset in release mode 50 | * jsBundleDirRelease: "$buildDir/intermediates/assets/release", 51 | * 52 | * // where to put drawable resources / React Native assets, e.g. the ones you use via 53 | * // require('./image.png')), in debug mode 54 | * resourcesDirDebug: "$buildDir/intermediates/res/merged/debug", 55 | * 56 | * // where to put drawable resources / React Native assets, e.g. the ones you use via 57 | * // require('./image.png')), in release mode 58 | * resourcesDirRelease: "$buildDir/intermediates/res/merged/release", 59 | * 60 | * // by default the gradle tasks are skipped if none of the JS files or assets change; this means 61 | * // that we don't look at files in android/ or ios/ to determine whether the tasks are up to 62 | * // date; if you have any other folders that you want to ignore for performance reasons (gradle 63 | * // indexes the entire tree), add them here. Alternatively, if you have JS files in android/ 64 | * // for example, you might want to remove it from here. 65 | * inputExcludes: ["android/**", "ios/**"], 66 | * 67 | * // override which node gets called and with what additional arguments 68 | * nodeExecutableAndArgs: ["node"], 69 | * 70 | * // supply additional arguments to the packager 71 | * extraPackagerArgs: [] 72 | * ] 73 | */ 74 | 75 | apply from: "../../node_modules/react-native/react.gradle" 76 | 77 | /** 78 | * Set this to true to create two separate APKs instead of one: 79 | * - An APK that only works on ARM devices 80 | * - An APK that only works on x86 devices 81 | * The advantage is the size of the APK is reduced by about 4MB. 82 | * Upload all the APKs to the Play Store and people will download 83 | * the correct one based on the CPU architecture of their device. 84 | */ 85 | def enableSeparateBuildPerCPUArchitecture = false 86 | 87 | /** 88 | * Run Proguard to shrink the Java bytecode in release builds. 89 | */ 90 | def enableProguardInReleaseBuilds = false 91 | 92 | android { 93 | compileSdkVersion 23 94 | buildToolsVersion '26.0.1' 95 | 96 | defaultConfig { 97 | applicationId "com.example" 98 | minSdkVersion 17 99 | targetSdkVersion 22 100 | versionCode 1 101 | versionName "1.0" 102 | ndk { 103 | abiFilters "armeabi-v7a", "x86" 104 | } 105 | } 106 | splits { 107 | abi { 108 | reset() 109 | enable enableSeparateBuildPerCPUArchitecture 110 | universalApk false // If true, also generate a universal APK 111 | include "armeabi-v7a", "x86" 112 | } 113 | } 114 | buildTypes { 115 | release { 116 | minifyEnabled enableProguardInReleaseBuilds 117 | proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro" 118 | } 119 | } 120 | // applicationVariants are e.g. debug, release 121 | applicationVariants.all { variant -> 122 | variant.outputs.each { output -> 123 | // For each separate APK per architecture, set a unique version code as described here: 124 | // http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits 125 | def versionCodes = ["armeabi-v7a":1, "x86":2] 126 | def abi = output.getFilter(OutputFile.ABI) 127 | if (abi != null) { // null for the universal-debug, universal-release variants 128 | output.versionCodeOverride = 129 | versionCodes.get(abi) * 1048576 + defaultConfig.versionCode 130 | } 131 | } 132 | } 133 | } 134 | 135 | dependencies { 136 | compile project(':react-native-webgl') 137 | compile project(':react-native-webgl-view-shot') 138 | compile fileTree(dir: "libs", include: ["*.jar"]) 139 | compile "com.android.support:appcompat-v7:23.0.1" 140 | compile "com.facebook.react:react-native:+" // From node_modules 141 | } 142 | 143 | // Run this once to be able to run the application with BUCK 144 | // puts all compile dependencies into folder libs for BUCK to use 145 | task copyDownloadableDepsToLibs(type: Copy) { 146 | from configurations.compile 147 | into 'libs' 148 | } 149 | -------------------------------------------------------------------------------- /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 | -keep,allowobfuscation @interface com.facebook.common.internal.DoNotStrip 30 | 31 | # Do not strip any method/class that is annotated with @DoNotStrip 32 | -keep @com.facebook.proguard.annotations.DoNotStrip class * 33 | -keep @com.facebook.common.internal.DoNotStrip class * 34 | -keepclassmembers class * { 35 | @com.facebook.proguard.annotations.DoNotStrip *; 36 | @com.facebook.common.internal.DoNotStrip *; 37 | } 38 | 39 | -keepclassmembers @com.facebook.proguard.annotations.KeepGettersAndSetters class * { 40 | void set*(***); 41 | *** get*(); 42 | } 43 | 44 | -keep class * extends com.facebook.react.bridge.JavaScriptModule { *; } 45 | -keep class * extends com.facebook.react.bridge.NativeModule { *; } 46 | -keepclassmembers,includedescriptorclasses class * { native ; } 47 | -keepclassmembers class * { @com.facebook.react.uimanager.UIProp ; } 48 | -keepclassmembers class * { @com.facebook.react.uimanager.annotations.ReactProp ; } 49 | -keepclassmembers class * { @com.facebook.react.uimanager.annotations.ReactPropGroup ; } 50 | 51 | -dontwarn com.facebook.react.** 52 | 53 | # TextLayoutBuilder uses a non-public Android constructor within StaticLayout. 54 | # See libs/proxy/src/main/java/com/facebook/fbui/textlayoutbuilder/proxy for details. 55 | -dontwarn android.text.StaticLayout 56 | 57 | # okhttp 58 | 59 | -keepattributes Signature 60 | -keepattributes *Annotation* 61 | -keep class okhttp3.** { *; } 62 | -keep interface okhttp3.** { *; } 63 | -dontwarn okhttp3.** 64 | 65 | # okio 66 | 67 | -keep class sun.misc.Unsafe { *; } 68 | -dontwarn java.nio.file.* 69 | -dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement 70 | -dontwarn okio.** 71 | -------------------------------------------------------------------------------- /example/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | 9 | 12 | 13 | 19 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /example/android/app/src/main/java/com/example/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.example; 2 | 3 | import com.facebook.react.ReactActivity; 4 | 5 | public class MainActivity extends ReactActivity { 6 | 7 | /** 8 | * Returns the name of the main component registered from JavaScript. 9 | * This is used to schedule rendering of the component. 10 | */ 11 | @Override 12 | protected String getMainComponentName() { 13 | return "example"; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /example/android/app/src/main/java/com/example/MainApplication.java: -------------------------------------------------------------------------------- 1 | package com.example; 2 | 3 | import android.app.Application; 4 | 5 | import com.facebook.react.ReactApplication; 6 | import fr.greweb.rnwebgl.RNWebGLPackage; 7 | import fr.greweb.rnwebglviewshot.RNWebGLViewShotPackage; 8 | import com.facebook.react.ReactNativeHost; 9 | import com.facebook.react.ReactPackage; 10 | import com.facebook.react.shell.MainReactPackage; 11 | import com.facebook.soloader.SoLoader; 12 | 13 | import java.util.Arrays; 14 | import java.util.List; 15 | 16 | public class MainApplication extends Application implements ReactApplication { 17 | 18 | private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) { 19 | @Override 20 | public boolean getUseDeveloperSupport() { 21 | return BuildConfig.DEBUG; 22 | } 23 | 24 | @Override 25 | protected List getPackages() { 26 | return Arrays.asList( 27 | new MainReactPackage(), 28 | new RNWebGLPackage(), 29 | new RNWebGLViewShotPackage() 30 | ); 31 | } 32 | }; 33 | 34 | @Override 35 | public ReactNativeHost getReactNativeHost() { 36 | return mReactNativeHost; 37 | } 38 | 39 | @Override 40 | public void onCreate() { 41 | super.onCreate(); 42 | SoLoader.init(this, /* native exopackage */ false); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gre/react-native-webgl-view-shot/6fea82c7b194c40e035d27007e7189896932dd0e/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/gre/react-native-webgl-view-shot/6fea82c7b194c40e035d27007e7189896932dd0e/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/gre/react-native-webgl-view-shot/6fea82c7b194c40e035d27007e7189896932dd0e/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/gre/react-native-webgl-view-shot/6fea82c7b194c40e035d27007e7189896932dd0e/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:2.3.3' 9 | classpath 'de.undercouch:gradle-download-task:3.1.2' 10 | 11 | // NOTE: Do not place your application dependencies here; they belong 12 | // in the individual module build.gradle files 13 | } 14 | } 15 | 16 | allprojects { 17 | repositories { 18 | mavenLocal() 19 | jcenter() 20 | maven { 21 | // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm 22 | url "$rootDir/../node_modules/react-native/android" 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /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/gre/react-native-webgl-view-shot/6fea82c7b194c40e035d27007e7189896932dd0e/example/android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /example/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Sat Aug 26 19:24:01 CEST 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip 7 | -------------------------------------------------------------------------------- /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/keystores/BUCK: -------------------------------------------------------------------------------- 1 | keystore( 2 | name = "debug", 3 | properties = "debug.keystore.properties", 4 | store = "debug.keystore", 5 | visibility = [ 6 | "PUBLIC", 7 | ], 8 | ) 9 | -------------------------------------------------------------------------------- /example/android/keystores/debug.keystore.properties: -------------------------------------------------------------------------------- 1 | key.store=debug.keystore 2 | key.alias=androiddebugkey 3 | key.store.password=android 4 | key.alias.password=android 5 | -------------------------------------------------------------------------------- /example/android/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'example' 2 | include ':react-native-webgl' 3 | project(':react-native-webgl').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-webgl/android') 4 | include ':react-native-webgl-view-shot' 5 | project(':react-native-webgl-view-shot').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-webgl-view-shot/android') 6 | 7 | include ':app' 8 | -------------------------------------------------------------------------------- /example/index.android.js: -------------------------------------------------------------------------------- 1 | import { AppRegistry } from 'react-native'; 2 | import App from './App'; 3 | AppRegistry.registerComponent('example', () => App); 4 | -------------------------------------------------------------------------------- /example/index.ios.js: -------------------------------------------------------------------------------- 1 | import { AppRegistry } from 'react-native'; 2 | import App from './App'; 3 | AppRegistry.registerComponent('example', () => App); 4 | -------------------------------------------------------------------------------- /example/ios/example-tvOS/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 | NSExceptionDomains 45 | 46 | localhost 47 | 48 | NSExceptionAllowsInsecureHTTPLoads 49 | 50 | 51 | 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /example/ios/example-tvOSTests/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/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 | 133E29F31AD74F7200F7D852 /* libRCTLinking.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 78C398B91ACF4ADC00677621 /* libRCTLinking.a */; }; 16 | 139105C61AF99C1200B5F7CC /* libRCTSettings.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 139105C11AF99BAD00B5F7CC /* libRCTSettings.a */; }; 17 | 139FDEF61B0652A700C62182 /* libRCTWebSocket.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 139FDEF41B06529B00C62182 /* libRCTWebSocket.a */; }; 18 | 13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.m */; }; 19 | 13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB11A68108700A75B9A /* LaunchScreen.xib */; }; 20 | 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; }; 21 | 13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; }; 22 | 146834051AC3E58100842450 /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 146834041AC3E56700842450 /* libReact.a */; }; 23 | 34AE91F61F517EC0007C49C6 /* libRNWebGL.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 34AE91E61F517E7A007C49C6 /* libRNWebGL.a */; }; 24 | 4EAC61C23A77487A9B19C968 /* libRNWebGLViewShot.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 011E8B0932924CE3BB152D30 /* libRNWebGLViewShot.a */; }; 25 | 5E9157361DD0AC6A00FF2AA8 /* libRCTAnimation.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5E9157331DD0AC6500FF2AA8 /* libRCTAnimation.a */; }; 26 | 832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 832341B51AAA6A8300B99B32 /* libRCTText.a */; }; 27 | /* End PBXBuildFile section */ 28 | 29 | /* Begin PBXContainerItemProxy section */ 30 | 00C302AB1ABCB8CE00DB3ED1 /* PBXContainerItemProxy */ = { 31 | isa = PBXContainerItemProxy; 32 | containerPortal = 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */; 33 | proxyType = 2; 34 | remoteGlobalIDString = 134814201AA4EA6300B7C361; 35 | remoteInfo = RCTActionSheet; 36 | }; 37 | 00C302B91ABCB90400DB3ED1 /* PBXContainerItemProxy */ = { 38 | isa = PBXContainerItemProxy; 39 | containerPortal = 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */; 40 | proxyType = 2; 41 | remoteGlobalIDString = 134814201AA4EA6300B7C361; 42 | remoteInfo = RCTGeolocation; 43 | }; 44 | 00C302BF1ABCB91800DB3ED1 /* PBXContainerItemProxy */ = { 45 | isa = PBXContainerItemProxy; 46 | containerPortal = 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */; 47 | proxyType = 2; 48 | remoteGlobalIDString = 58B5115D1A9E6B3D00147676; 49 | remoteInfo = RCTImage; 50 | }; 51 | 00C302DB1ABCB9D200DB3ED1 /* PBXContainerItemProxy */ = { 52 | isa = PBXContainerItemProxy; 53 | containerPortal = 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */; 54 | proxyType = 2; 55 | remoteGlobalIDString = 58B511DB1A9E6C8500147676; 56 | remoteInfo = RCTNetwork; 57 | }; 58 | 00C302E31ABCB9EE00DB3ED1 /* PBXContainerItemProxy */ = { 59 | isa = PBXContainerItemProxy; 60 | containerPortal = 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */; 61 | proxyType = 2; 62 | remoteGlobalIDString = 832C81801AAF6DEF007FA2F7; 63 | remoteInfo = RCTVibration; 64 | }; 65 | 139105C01AF99BAD00B5F7CC /* PBXContainerItemProxy */ = { 66 | isa = PBXContainerItemProxy; 67 | containerPortal = 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */; 68 | proxyType = 2; 69 | remoteGlobalIDString = 134814201AA4EA6300B7C361; 70 | remoteInfo = RCTSettings; 71 | }; 72 | 139FDEF31B06529B00C62182 /* PBXContainerItemProxy */ = { 73 | isa = PBXContainerItemProxy; 74 | containerPortal = 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */; 75 | proxyType = 2; 76 | remoteGlobalIDString = 3C86DF461ADF2C930047B81A; 77 | remoteInfo = RCTWebSocket; 78 | }; 79 | 146834031AC3E56700842450 /* PBXContainerItemProxy */ = { 80 | isa = PBXContainerItemProxy; 81 | containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */; 82 | proxyType = 2; 83 | remoteGlobalIDString = 83CBBA2E1A601D0E00E9B192; 84 | remoteInfo = React; 85 | }; 86 | 3435BBD81F519D0D00424CDE /* PBXContainerItemProxy */ = { 87 | isa = PBXContainerItemProxy; 88 | containerPortal = 34AE91F01F517E94007C49C6 /* RNWebGLViewShot.xcodeproj */; 89 | proxyType = 2; 90 | remoteGlobalIDString = 134814201AA4EA6300B7C361; 91 | remoteInfo = RNWebGLViewShot; 92 | }; 93 | 34AE91DC1F517E7A007C49C6 /* PBXContainerItemProxy */ = { 94 | isa = PBXContainerItemProxy; 95 | containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */; 96 | proxyType = 2; 97 | remoteGlobalIDString = 139D7ECE1E25DB7D00323FB7; 98 | remoteInfo = "third-party"; 99 | }; 100 | 34AE91DE1F517E7A007C49C6 /* PBXContainerItemProxy */ = { 101 | isa = PBXContainerItemProxy; 102 | containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */; 103 | proxyType = 2; 104 | remoteGlobalIDString = 3D383D3C1EBD27B6005632C8; 105 | remoteInfo = "third-party-tvOS"; 106 | }; 107 | 34AE91E01F517E7A007C49C6 /* PBXContainerItemProxy */ = { 108 | isa = PBXContainerItemProxy; 109 | containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */; 110 | proxyType = 2; 111 | remoteGlobalIDString = 139D7E881E25C6D100323FB7; 112 | remoteInfo = "double-conversion"; 113 | }; 114 | 34AE91E21F517E7A007C49C6 /* PBXContainerItemProxy */ = { 115 | isa = PBXContainerItemProxy; 116 | containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */; 117 | proxyType = 2; 118 | remoteGlobalIDString = 3D383D621EBD27B9005632C8; 119 | remoteInfo = "double-conversion-tvOS"; 120 | }; 121 | 34AE91E51F517E7A007C49C6 /* PBXContainerItemProxy */ = { 122 | isa = PBXContainerItemProxy; 123 | containerPortal = E5F73DF8365D4632B1396041 /* RNWebGL.xcodeproj */; 124 | proxyType = 2; 125 | remoteGlobalIDString = 4107012F1ACB723B00C6AA39; 126 | remoteInfo = RNWebGL; 127 | }; 128 | 3DAD3E831DF850E9000B6D8A /* PBXContainerItemProxy */ = { 129 | isa = PBXContainerItemProxy; 130 | containerPortal = 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */; 131 | proxyType = 2; 132 | remoteGlobalIDString = 2D2A283A1D9B042B00D4039D; 133 | remoteInfo = "RCTImage-tvOS"; 134 | }; 135 | 3DAD3E871DF850E9000B6D8A /* PBXContainerItemProxy */ = { 136 | isa = PBXContainerItemProxy; 137 | containerPortal = 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */; 138 | proxyType = 2; 139 | remoteGlobalIDString = 2D2A28471D9B043800D4039D; 140 | remoteInfo = "RCTLinking-tvOS"; 141 | }; 142 | 3DAD3E8B1DF850E9000B6D8A /* PBXContainerItemProxy */ = { 143 | isa = PBXContainerItemProxy; 144 | containerPortal = 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */; 145 | proxyType = 2; 146 | remoteGlobalIDString = 2D2A28541D9B044C00D4039D; 147 | remoteInfo = "RCTNetwork-tvOS"; 148 | }; 149 | 3DAD3E8F1DF850E9000B6D8A /* PBXContainerItemProxy */ = { 150 | isa = PBXContainerItemProxy; 151 | containerPortal = 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */; 152 | proxyType = 2; 153 | remoteGlobalIDString = 2D2A28611D9B046600D4039D; 154 | remoteInfo = "RCTSettings-tvOS"; 155 | }; 156 | 3DAD3E931DF850E9000B6D8A /* PBXContainerItemProxy */ = { 157 | isa = PBXContainerItemProxy; 158 | containerPortal = 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */; 159 | proxyType = 2; 160 | remoteGlobalIDString = 2D2A287B1D9B048500D4039D; 161 | remoteInfo = "RCTText-tvOS"; 162 | }; 163 | 3DAD3E981DF850E9000B6D8A /* PBXContainerItemProxy */ = { 164 | isa = PBXContainerItemProxy; 165 | containerPortal = 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */; 166 | proxyType = 2; 167 | remoteGlobalIDString = 2D2A28881D9B049200D4039D; 168 | remoteInfo = "RCTWebSocket-tvOS"; 169 | }; 170 | 3DAD3EA21DF850E9000B6D8A /* PBXContainerItemProxy */ = { 171 | isa = PBXContainerItemProxy; 172 | containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */; 173 | proxyType = 2; 174 | remoteGlobalIDString = 2D2A28131D9B038B00D4039D; 175 | remoteInfo = "React-tvOS"; 176 | }; 177 | 3DAD3EA41DF850E9000B6D8A /* PBXContainerItemProxy */ = { 178 | isa = PBXContainerItemProxy; 179 | containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */; 180 | proxyType = 2; 181 | remoteGlobalIDString = 3D3C059A1DE3340900C268FA; 182 | remoteInfo = yoga; 183 | }; 184 | 3DAD3EA61DF850E9000B6D8A /* PBXContainerItemProxy */ = { 185 | isa = PBXContainerItemProxy; 186 | containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */; 187 | proxyType = 2; 188 | remoteGlobalIDString = 3D3C06751DE3340C00C268FA; 189 | remoteInfo = "yoga-tvOS"; 190 | }; 191 | 3DAD3EA81DF850E9000B6D8A /* PBXContainerItemProxy */ = { 192 | isa = PBXContainerItemProxy; 193 | containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */; 194 | proxyType = 2; 195 | remoteGlobalIDString = 3D3CD9251DE5FBEC00167DC4; 196 | remoteInfo = cxxreact; 197 | }; 198 | 3DAD3EAA1DF850E9000B6D8A /* PBXContainerItemProxy */ = { 199 | isa = PBXContainerItemProxy; 200 | containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */; 201 | proxyType = 2; 202 | remoteGlobalIDString = 3D3CD9321DE5FBEE00167DC4; 203 | remoteInfo = "cxxreact-tvOS"; 204 | }; 205 | 3DAD3EAC1DF850E9000B6D8A /* PBXContainerItemProxy */ = { 206 | isa = PBXContainerItemProxy; 207 | containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */; 208 | proxyType = 2; 209 | remoteGlobalIDString = 3D3CD90B1DE5FBD600167DC4; 210 | remoteInfo = jschelpers; 211 | }; 212 | 3DAD3EAE1DF850E9000B6D8A /* PBXContainerItemProxy */ = { 213 | isa = PBXContainerItemProxy; 214 | containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */; 215 | proxyType = 2; 216 | remoteGlobalIDString = 3D3CD9181DE5FBD800167DC4; 217 | remoteInfo = "jschelpers-tvOS"; 218 | }; 219 | 5E9157321DD0AC6500FF2AA8 /* PBXContainerItemProxy */ = { 220 | isa = PBXContainerItemProxy; 221 | containerPortal = 5E91572D1DD0AC6500FF2AA8 /* RCTAnimation.xcodeproj */; 222 | proxyType = 2; 223 | remoteGlobalIDString = 134814201AA4EA6300B7C361; 224 | remoteInfo = RCTAnimation; 225 | }; 226 | 5E9157341DD0AC6500FF2AA8 /* PBXContainerItemProxy */ = { 227 | isa = PBXContainerItemProxy; 228 | containerPortal = 5E91572D1DD0AC6500FF2AA8 /* RCTAnimation.xcodeproj */; 229 | proxyType = 2; 230 | remoteGlobalIDString = 2D2A28201D9B03D100D4039D; 231 | remoteInfo = "RCTAnimation-tvOS"; 232 | }; 233 | 78C398B81ACF4ADC00677621 /* PBXContainerItemProxy */ = { 234 | isa = PBXContainerItemProxy; 235 | containerPortal = 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */; 236 | proxyType = 2; 237 | remoteGlobalIDString = 134814201AA4EA6300B7C361; 238 | remoteInfo = RCTLinking; 239 | }; 240 | 832341B41AAA6A8300B99B32 /* PBXContainerItemProxy */ = { 241 | isa = PBXContainerItemProxy; 242 | containerPortal = 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */; 243 | proxyType = 2; 244 | remoteGlobalIDString = 58B5119B1A9E6C1200147676; 245 | remoteInfo = RCTText; 246 | }; 247 | /* End PBXContainerItemProxy section */ 248 | 249 | /* Begin PBXFileReference section */ 250 | 008F07F21AC5B25A0029DE68 /* main.jsbundle */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = main.jsbundle; sourceTree = ""; }; 251 | 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTActionSheet.xcodeproj; path = "../node_modules/react-native/Libraries/ActionSheetIOS/RCTActionSheet.xcodeproj"; sourceTree = ""; }; 252 | 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTGeolocation.xcodeproj; path = "../node_modules/react-native/Libraries/Geolocation/RCTGeolocation.xcodeproj"; sourceTree = ""; }; 253 | 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTImage.xcodeproj; path = "../node_modules/react-native/Libraries/Image/RCTImage.xcodeproj"; sourceTree = ""; }; 254 | 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTNetwork.xcodeproj; path = "../node_modules/react-native/Libraries/Network/RCTNetwork.xcodeproj"; sourceTree = ""; }; 255 | 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTVibration.xcodeproj; path = "../node_modules/react-native/Libraries/Vibration/RCTVibration.xcodeproj"; sourceTree = ""; }; 256 | 00E356F11AD99517003FC87E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 257 | 00E356F21AD99517003FC87E /* exampleTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = exampleTests.m; sourceTree = ""; }; 258 | 011E8B0932924CE3BB152D30 /* libRNWebGLViewShot.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = libRNWebGLViewShot.a; sourceTree = ""; }; 259 | 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTSettings.xcodeproj; path = "../node_modules/react-native/Libraries/Settings/RCTSettings.xcodeproj"; sourceTree = ""; }; 260 | 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTWebSocket.xcodeproj; path = "../node_modules/react-native/Libraries/WebSocket/RCTWebSocket.xcodeproj"; sourceTree = ""; }; 261 | 13B07F961A680F5B00A75B9A /* example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = example.app; sourceTree = BUILT_PRODUCTS_DIR; }; 262 | 13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = example/AppDelegate.h; sourceTree = ""; }; 263 | 13B07FB01A68108700A75B9A /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AppDelegate.m; path = example/AppDelegate.m; sourceTree = ""; }; 264 | 13B07FB21A68108700A75B9A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; 265 | 13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = example/Images.xcassets; sourceTree = ""; }; 266 | 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = example/Info.plist; sourceTree = ""; }; 267 | 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = example/main.m; sourceTree = ""; }; 268 | 146833FF1AC3E56700842450 /* React.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = React.xcodeproj; path = "../node_modules/react-native/React/React.xcodeproj"; sourceTree = ""; }; 269 | 34AE91F01F517E94007C49C6 /* RNWebGLViewShot.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RNWebGLViewShot.xcodeproj; path = ../../ios/RNWebGLViewShot.xcodeproj; sourceTree = ""; }; 270 | 5E91572D1DD0AC6500FF2AA8 /* RCTAnimation.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTAnimation.xcodeproj; path = "../node_modules/react-native/Libraries/NativeAnimation/RCTAnimation.xcodeproj"; sourceTree = ""; }; 271 | 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTLinking.xcodeproj; path = "../node_modules/react-native/Libraries/LinkingIOS/RCTLinking.xcodeproj"; sourceTree = ""; }; 272 | 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTText.xcodeproj; path = "../node_modules/react-native/Libraries/Text/RCTText.xcodeproj"; sourceTree = ""; }; 273 | E5F73DF8365D4632B1396041 /* RNWebGL.xcodeproj */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = "wrapper.pb-project"; name = RNWebGL.xcodeproj; path = "../node_modules/react-native-webgl/ios/RNWebGL.xcodeproj"; sourceTree = ""; }; 274 | /* End PBXFileReference section */ 275 | 276 | /* Begin PBXFrameworksBuildPhase section */ 277 | 13B07F8C1A680F5B00A75B9A /* Frameworks */ = { 278 | isa = PBXFrameworksBuildPhase; 279 | buildActionMask = 2147483647; 280 | files = ( 281 | 34AE91F61F517EC0007C49C6 /* libRNWebGL.a in Frameworks */, 282 | 146834051AC3E58100842450 /* libReact.a in Frameworks */, 283 | 5E9157361DD0AC6A00FF2AA8 /* libRCTAnimation.a in Frameworks */, 284 | 00C302E51ABCBA2D00DB3ED1 /* libRCTActionSheet.a in Frameworks */, 285 | 00C302E71ABCBA2D00DB3ED1 /* libRCTGeolocation.a in Frameworks */, 286 | 00C302E81ABCBA2D00DB3ED1 /* libRCTImage.a in Frameworks */, 287 | 133E29F31AD74F7200F7D852 /* libRCTLinking.a in Frameworks */, 288 | 00C302E91ABCBA2D00DB3ED1 /* libRCTNetwork.a in Frameworks */, 289 | 139105C61AF99C1200B5F7CC /* libRCTSettings.a in Frameworks */, 290 | 832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */, 291 | 00C302EA1ABCBA2D00DB3ED1 /* libRCTVibration.a in Frameworks */, 292 | 139FDEF61B0652A700C62182 /* libRCTWebSocket.a in Frameworks */, 293 | 4EAC61C23A77487A9B19C968 /* libRNWebGLViewShot.a in Frameworks */, 294 | ); 295 | runOnlyForDeploymentPostprocessing = 0; 296 | }; 297 | /* End PBXFrameworksBuildPhase section */ 298 | 299 | /* Begin PBXGroup section */ 300 | 00C302A81ABCB8CE00DB3ED1 /* Products */ = { 301 | isa = PBXGroup; 302 | children = ( 303 | 00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */, 304 | ); 305 | name = Products; 306 | sourceTree = ""; 307 | }; 308 | 00C302B61ABCB90400DB3ED1 /* Products */ = { 309 | isa = PBXGroup; 310 | children = ( 311 | 00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */, 312 | ); 313 | name = Products; 314 | sourceTree = ""; 315 | }; 316 | 00C302BC1ABCB91800DB3ED1 /* Products */ = { 317 | isa = PBXGroup; 318 | children = ( 319 | 00C302C01ABCB91800DB3ED1 /* libRCTImage.a */, 320 | 3DAD3E841DF850E9000B6D8A /* libRCTImage-tvOS.a */, 321 | ); 322 | name = Products; 323 | sourceTree = ""; 324 | }; 325 | 00C302D41ABCB9D200DB3ED1 /* Products */ = { 326 | isa = PBXGroup; 327 | children = ( 328 | 00C302DC1ABCB9D200DB3ED1 /* libRCTNetwork.a */, 329 | 3DAD3E8C1DF850E9000B6D8A /* libRCTNetwork-tvOS.a */, 330 | ); 331 | name = Products; 332 | sourceTree = ""; 333 | }; 334 | 00C302E01ABCB9EE00DB3ED1 /* Products */ = { 335 | isa = PBXGroup; 336 | children = ( 337 | 00C302E41ABCB9EE00DB3ED1 /* libRCTVibration.a */, 338 | ); 339 | name = Products; 340 | sourceTree = ""; 341 | }; 342 | 00E356EF1AD99517003FC87E /* exampleTests */ = { 343 | isa = PBXGroup; 344 | children = ( 345 | 00E356F21AD99517003FC87E /* exampleTests.m */, 346 | 00E356F01AD99517003FC87E /* Supporting Files */, 347 | ); 348 | path = exampleTests; 349 | sourceTree = ""; 350 | }; 351 | 00E356F01AD99517003FC87E /* Supporting Files */ = { 352 | isa = PBXGroup; 353 | children = ( 354 | 00E356F11AD99517003FC87E /* Info.plist */, 355 | ); 356 | name = "Supporting Files"; 357 | sourceTree = ""; 358 | }; 359 | 139105B71AF99BAD00B5F7CC /* Products */ = { 360 | isa = PBXGroup; 361 | children = ( 362 | 139105C11AF99BAD00B5F7CC /* libRCTSettings.a */, 363 | 3DAD3E901DF850E9000B6D8A /* libRCTSettings-tvOS.a */, 364 | ); 365 | name = Products; 366 | sourceTree = ""; 367 | }; 368 | 139FDEE71B06529A00C62182 /* Products */ = { 369 | isa = PBXGroup; 370 | children = ( 371 | 139FDEF41B06529B00C62182 /* libRCTWebSocket.a */, 372 | 3DAD3E991DF850E9000B6D8A /* libRCTWebSocket-tvOS.a */, 373 | ); 374 | name = Products; 375 | sourceTree = ""; 376 | }; 377 | 13B07FAE1A68108700A75B9A /* example */ = { 378 | isa = PBXGroup; 379 | children = ( 380 | 008F07F21AC5B25A0029DE68 /* main.jsbundle */, 381 | 13B07FAF1A68108700A75B9A /* AppDelegate.h */, 382 | 13B07FB01A68108700A75B9A /* AppDelegate.m */, 383 | 13B07FB51A68108700A75B9A /* Images.xcassets */, 384 | 13B07FB61A68108700A75B9A /* Info.plist */, 385 | 13B07FB11A68108700A75B9A /* LaunchScreen.xib */, 386 | 13B07FB71A68108700A75B9A /* main.m */, 387 | ); 388 | name = example; 389 | sourceTree = ""; 390 | }; 391 | 146834001AC3E56700842450 /* Products */ = { 392 | isa = PBXGroup; 393 | children = ( 394 | 146834041AC3E56700842450 /* libReact.a */, 395 | 3DAD3EA31DF850E9000B6D8A /* libReact.a */, 396 | 3DAD3EA51DF850E9000B6D8A /* libyoga.a */, 397 | 3DAD3EA71DF850E9000B6D8A /* libyoga.a */, 398 | 3DAD3EA91DF850E9000B6D8A /* libcxxreact.a */, 399 | 3DAD3EAB1DF850E9000B6D8A /* libcxxreact.a */, 400 | 3DAD3EAD1DF850E9000B6D8A /* libjschelpers.a */, 401 | 3DAD3EAF1DF850E9000B6D8A /* libjschelpers.a */, 402 | 34AE91DD1F517E7A007C49C6 /* libthird-party.a */, 403 | 34AE91DF1F517E7A007C49C6 /* libthird-party.a */, 404 | 34AE91E11F517E7A007C49C6 /* libdouble-conversion.a */, 405 | 34AE91E31F517E7A007C49C6 /* libdouble-conversion.a */, 406 | ); 407 | name = Products; 408 | sourceTree = ""; 409 | }; 410 | 3435BBB71F519D0D00424CDE /* Products */ = { 411 | isa = PBXGroup; 412 | children = ( 413 | 3435BBD91F519D0D00424CDE /* libRNWebGLViewShot.a */, 414 | ); 415 | name = Products; 416 | sourceTree = ""; 417 | }; 418 | 34AE91BD1F517E7A007C49C6 /* Products */ = { 419 | isa = PBXGroup; 420 | children = ( 421 | 34AE91E61F517E7A007C49C6 /* libRNWebGL.a */, 422 | ); 423 | name = Products; 424 | sourceTree = ""; 425 | }; 426 | 5E91572E1DD0AC6500FF2AA8 /* Products */ = { 427 | isa = PBXGroup; 428 | children = ( 429 | 5E9157331DD0AC6500FF2AA8 /* libRCTAnimation.a */, 430 | 5E9157351DD0AC6500FF2AA8 /* libRCTAnimation.a */, 431 | ); 432 | name = Products; 433 | sourceTree = ""; 434 | }; 435 | 78C398B11ACF4ADC00677621 /* Products */ = { 436 | isa = PBXGroup; 437 | children = ( 438 | 78C398B91ACF4ADC00677621 /* libRCTLinking.a */, 439 | 3DAD3E881DF850E9000B6D8A /* libRCTLinking-tvOS.a */, 440 | ); 441 | name = Products; 442 | sourceTree = ""; 443 | }; 444 | 832341AE1AAA6A7D00B99B32 /* Libraries */ = { 445 | isa = PBXGroup; 446 | children = ( 447 | 5E91572D1DD0AC6500FF2AA8 /* RCTAnimation.xcodeproj */, 448 | 146833FF1AC3E56700842450 /* React.xcodeproj */, 449 | 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */, 450 | 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */, 451 | 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */, 452 | 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */, 453 | 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */, 454 | 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */, 455 | 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */, 456 | 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */, 457 | 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */, 458 | E5F73DF8365D4632B1396041 /* RNWebGL.xcodeproj */, 459 | 34AE91F01F517E94007C49C6 /* RNWebGLViewShot.xcodeproj */, 460 | ); 461 | name = Libraries; 462 | sourceTree = ""; 463 | }; 464 | 832341B11AAA6A8300B99B32 /* Products */ = { 465 | isa = PBXGroup; 466 | children = ( 467 | 832341B51AAA6A8300B99B32 /* libRCTText.a */, 468 | 3DAD3E941DF850E9000B6D8A /* libRCTText-tvOS.a */, 469 | ); 470 | name = Products; 471 | sourceTree = ""; 472 | }; 473 | 83CBB9F61A601CBA00E9B192 = { 474 | isa = PBXGroup; 475 | children = ( 476 | 13B07FAE1A68108700A75B9A /* example */, 477 | 832341AE1AAA6A7D00B99B32 /* Libraries */, 478 | 00E356EF1AD99517003FC87E /* exampleTests */, 479 | 83CBBA001A601CBA00E9B192 /* Products */, 480 | ); 481 | indentWidth = 2; 482 | sourceTree = ""; 483 | tabWidth = 2; 484 | }; 485 | 83CBBA001A601CBA00E9B192 /* Products */ = { 486 | isa = PBXGroup; 487 | children = ( 488 | 13B07F961A680F5B00A75B9A /* example.app */, 489 | ); 490 | name = Products; 491 | sourceTree = ""; 492 | }; 493 | /* End PBXGroup section */ 494 | 495 | /* Begin PBXNativeTarget section */ 496 | 13B07F861A680F5B00A75B9A /* example */ = { 497 | isa = PBXNativeTarget; 498 | buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "example" */; 499 | buildPhases = ( 500 | 13B07F871A680F5B00A75B9A /* Sources */, 501 | 13B07F8C1A680F5B00A75B9A /* Frameworks */, 502 | 13B07F8E1A680F5B00A75B9A /* Resources */, 503 | 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */, 504 | ); 505 | buildRules = ( 506 | ); 507 | dependencies = ( 508 | ); 509 | name = example; 510 | productName = "Hello World"; 511 | productReference = 13B07F961A680F5B00A75B9A /* example.app */; 512 | productType = "com.apple.product-type.application"; 513 | }; 514 | /* End PBXNativeTarget section */ 515 | 516 | /* Begin PBXProject section */ 517 | 83CBB9F71A601CBA00E9B192 /* Project object */ = { 518 | isa = PBXProject; 519 | attributes = { 520 | LastUpgradeCheck = 610; 521 | ORGANIZATIONNAME = Facebook; 522 | TargetAttributes = { 523 | 13B07F861A680F5B00A75B9A = { 524 | DevelopmentTeam = LYJDLXDTQ5; 525 | }; 526 | }; 527 | }; 528 | buildConfigurationList = 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "example" */; 529 | compatibilityVersion = "Xcode 3.2"; 530 | developmentRegion = English; 531 | hasScannedForEncodings = 0; 532 | knownRegions = ( 533 | en, 534 | Base, 535 | ); 536 | mainGroup = 83CBB9F61A601CBA00E9B192; 537 | productRefGroup = 83CBBA001A601CBA00E9B192 /* Products */; 538 | projectDirPath = ""; 539 | projectReferences = ( 540 | { 541 | ProductGroup = 00C302A81ABCB8CE00DB3ED1 /* Products */; 542 | ProjectRef = 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */; 543 | }, 544 | { 545 | ProductGroup = 5E91572E1DD0AC6500FF2AA8 /* Products */; 546 | ProjectRef = 5E91572D1DD0AC6500FF2AA8 /* RCTAnimation.xcodeproj */; 547 | }, 548 | { 549 | ProductGroup = 00C302B61ABCB90400DB3ED1 /* Products */; 550 | ProjectRef = 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */; 551 | }, 552 | { 553 | ProductGroup = 00C302BC1ABCB91800DB3ED1 /* Products */; 554 | ProjectRef = 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */; 555 | }, 556 | { 557 | ProductGroup = 78C398B11ACF4ADC00677621 /* Products */; 558 | ProjectRef = 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */; 559 | }, 560 | { 561 | ProductGroup = 00C302D41ABCB9D200DB3ED1 /* Products */; 562 | ProjectRef = 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */; 563 | }, 564 | { 565 | ProductGroup = 139105B71AF99BAD00B5F7CC /* Products */; 566 | ProjectRef = 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */; 567 | }, 568 | { 569 | ProductGroup = 832341B11AAA6A8300B99B32 /* Products */; 570 | ProjectRef = 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */; 571 | }, 572 | { 573 | ProductGroup = 00C302E01ABCB9EE00DB3ED1 /* Products */; 574 | ProjectRef = 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */; 575 | }, 576 | { 577 | ProductGroup = 139FDEE71B06529A00C62182 /* Products */; 578 | ProjectRef = 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */; 579 | }, 580 | { 581 | ProductGroup = 146834001AC3E56700842450 /* Products */; 582 | ProjectRef = 146833FF1AC3E56700842450 /* React.xcodeproj */; 583 | }, 584 | { 585 | ProductGroup = 34AE91BD1F517E7A007C49C6 /* Products */; 586 | ProjectRef = E5F73DF8365D4632B1396041 /* RNWebGL.xcodeproj */; 587 | }, 588 | { 589 | ProductGroup = 3435BBB71F519D0D00424CDE /* Products */; 590 | ProjectRef = 34AE91F01F517E94007C49C6 /* RNWebGLViewShot.xcodeproj */; 591 | }, 592 | ); 593 | projectRoot = ""; 594 | targets = ( 595 | 13B07F861A680F5B00A75B9A /* example */, 596 | ); 597 | }; 598 | /* End PBXProject section */ 599 | 600 | /* Begin PBXReferenceProxy section */ 601 | 00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */ = { 602 | isa = PBXReferenceProxy; 603 | fileType = archive.ar; 604 | path = libRCTActionSheet.a; 605 | remoteRef = 00C302AB1ABCB8CE00DB3ED1 /* PBXContainerItemProxy */; 606 | sourceTree = BUILT_PRODUCTS_DIR; 607 | }; 608 | 00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */ = { 609 | isa = PBXReferenceProxy; 610 | fileType = archive.ar; 611 | path = libRCTGeolocation.a; 612 | remoteRef = 00C302B91ABCB90400DB3ED1 /* PBXContainerItemProxy */; 613 | sourceTree = BUILT_PRODUCTS_DIR; 614 | }; 615 | 00C302C01ABCB91800DB3ED1 /* libRCTImage.a */ = { 616 | isa = PBXReferenceProxy; 617 | fileType = archive.ar; 618 | path = libRCTImage.a; 619 | remoteRef = 00C302BF1ABCB91800DB3ED1 /* PBXContainerItemProxy */; 620 | sourceTree = BUILT_PRODUCTS_DIR; 621 | }; 622 | 00C302DC1ABCB9D200DB3ED1 /* libRCTNetwork.a */ = { 623 | isa = PBXReferenceProxy; 624 | fileType = archive.ar; 625 | path = libRCTNetwork.a; 626 | remoteRef = 00C302DB1ABCB9D200DB3ED1 /* PBXContainerItemProxy */; 627 | sourceTree = BUILT_PRODUCTS_DIR; 628 | }; 629 | 00C302E41ABCB9EE00DB3ED1 /* libRCTVibration.a */ = { 630 | isa = PBXReferenceProxy; 631 | fileType = archive.ar; 632 | path = libRCTVibration.a; 633 | remoteRef = 00C302E31ABCB9EE00DB3ED1 /* PBXContainerItemProxy */; 634 | sourceTree = BUILT_PRODUCTS_DIR; 635 | }; 636 | 139105C11AF99BAD00B5F7CC /* libRCTSettings.a */ = { 637 | isa = PBXReferenceProxy; 638 | fileType = archive.ar; 639 | path = libRCTSettings.a; 640 | remoteRef = 139105C01AF99BAD00B5F7CC /* PBXContainerItemProxy */; 641 | sourceTree = BUILT_PRODUCTS_DIR; 642 | }; 643 | 139FDEF41B06529B00C62182 /* libRCTWebSocket.a */ = { 644 | isa = PBXReferenceProxy; 645 | fileType = archive.ar; 646 | path = libRCTWebSocket.a; 647 | remoteRef = 139FDEF31B06529B00C62182 /* PBXContainerItemProxy */; 648 | sourceTree = BUILT_PRODUCTS_DIR; 649 | }; 650 | 146834041AC3E56700842450 /* libReact.a */ = { 651 | isa = PBXReferenceProxy; 652 | fileType = archive.ar; 653 | path = libReact.a; 654 | remoteRef = 146834031AC3E56700842450 /* PBXContainerItemProxy */; 655 | sourceTree = BUILT_PRODUCTS_DIR; 656 | }; 657 | 3435BBD91F519D0D00424CDE /* libRNWebGLViewShot.a */ = { 658 | isa = PBXReferenceProxy; 659 | fileType = archive.ar; 660 | path = libRNWebGLViewShot.a; 661 | remoteRef = 3435BBD81F519D0D00424CDE /* PBXContainerItemProxy */; 662 | sourceTree = BUILT_PRODUCTS_DIR; 663 | }; 664 | 34AE91DD1F517E7A007C49C6 /* libthird-party.a */ = { 665 | isa = PBXReferenceProxy; 666 | fileType = archive.ar; 667 | path = "libthird-party.a"; 668 | remoteRef = 34AE91DC1F517E7A007C49C6 /* PBXContainerItemProxy */; 669 | sourceTree = BUILT_PRODUCTS_DIR; 670 | }; 671 | 34AE91DF1F517E7A007C49C6 /* libthird-party.a */ = { 672 | isa = PBXReferenceProxy; 673 | fileType = archive.ar; 674 | path = "libthird-party.a"; 675 | remoteRef = 34AE91DE1F517E7A007C49C6 /* PBXContainerItemProxy */; 676 | sourceTree = BUILT_PRODUCTS_DIR; 677 | }; 678 | 34AE91E11F517E7A007C49C6 /* libdouble-conversion.a */ = { 679 | isa = PBXReferenceProxy; 680 | fileType = archive.ar; 681 | path = "libdouble-conversion.a"; 682 | remoteRef = 34AE91E01F517E7A007C49C6 /* PBXContainerItemProxy */; 683 | sourceTree = BUILT_PRODUCTS_DIR; 684 | }; 685 | 34AE91E31F517E7A007C49C6 /* libdouble-conversion.a */ = { 686 | isa = PBXReferenceProxy; 687 | fileType = archive.ar; 688 | path = "libdouble-conversion.a"; 689 | remoteRef = 34AE91E21F517E7A007C49C6 /* PBXContainerItemProxy */; 690 | sourceTree = BUILT_PRODUCTS_DIR; 691 | }; 692 | 34AE91E61F517E7A007C49C6 /* libRNWebGL.a */ = { 693 | isa = PBXReferenceProxy; 694 | fileType = archive.ar; 695 | path = libRNWebGL.a; 696 | remoteRef = 34AE91E51F517E7A007C49C6 /* PBXContainerItemProxy */; 697 | sourceTree = BUILT_PRODUCTS_DIR; 698 | }; 699 | 3DAD3E841DF850E9000B6D8A /* libRCTImage-tvOS.a */ = { 700 | isa = PBXReferenceProxy; 701 | fileType = archive.ar; 702 | path = "libRCTImage-tvOS.a"; 703 | remoteRef = 3DAD3E831DF850E9000B6D8A /* PBXContainerItemProxy */; 704 | sourceTree = BUILT_PRODUCTS_DIR; 705 | }; 706 | 3DAD3E881DF850E9000B6D8A /* libRCTLinking-tvOS.a */ = { 707 | isa = PBXReferenceProxy; 708 | fileType = archive.ar; 709 | path = "libRCTLinking-tvOS.a"; 710 | remoteRef = 3DAD3E871DF850E9000B6D8A /* PBXContainerItemProxy */; 711 | sourceTree = BUILT_PRODUCTS_DIR; 712 | }; 713 | 3DAD3E8C1DF850E9000B6D8A /* libRCTNetwork-tvOS.a */ = { 714 | isa = PBXReferenceProxy; 715 | fileType = archive.ar; 716 | path = "libRCTNetwork-tvOS.a"; 717 | remoteRef = 3DAD3E8B1DF850E9000B6D8A /* PBXContainerItemProxy */; 718 | sourceTree = BUILT_PRODUCTS_DIR; 719 | }; 720 | 3DAD3E901DF850E9000B6D8A /* libRCTSettings-tvOS.a */ = { 721 | isa = PBXReferenceProxy; 722 | fileType = archive.ar; 723 | path = "libRCTSettings-tvOS.a"; 724 | remoteRef = 3DAD3E8F1DF850E9000B6D8A /* PBXContainerItemProxy */; 725 | sourceTree = BUILT_PRODUCTS_DIR; 726 | }; 727 | 3DAD3E941DF850E9000B6D8A /* libRCTText-tvOS.a */ = { 728 | isa = PBXReferenceProxy; 729 | fileType = archive.ar; 730 | path = "libRCTText-tvOS.a"; 731 | remoteRef = 3DAD3E931DF850E9000B6D8A /* PBXContainerItemProxy */; 732 | sourceTree = BUILT_PRODUCTS_DIR; 733 | }; 734 | 3DAD3E991DF850E9000B6D8A /* libRCTWebSocket-tvOS.a */ = { 735 | isa = PBXReferenceProxy; 736 | fileType = archive.ar; 737 | path = "libRCTWebSocket-tvOS.a"; 738 | remoteRef = 3DAD3E981DF850E9000B6D8A /* PBXContainerItemProxy */; 739 | sourceTree = BUILT_PRODUCTS_DIR; 740 | }; 741 | 3DAD3EA31DF850E9000B6D8A /* libReact.a */ = { 742 | isa = PBXReferenceProxy; 743 | fileType = archive.ar; 744 | path = libReact.a; 745 | remoteRef = 3DAD3EA21DF850E9000B6D8A /* PBXContainerItemProxy */; 746 | sourceTree = BUILT_PRODUCTS_DIR; 747 | }; 748 | 3DAD3EA51DF850E9000B6D8A /* libyoga.a */ = { 749 | isa = PBXReferenceProxy; 750 | fileType = archive.ar; 751 | path = libyoga.a; 752 | remoteRef = 3DAD3EA41DF850E9000B6D8A /* PBXContainerItemProxy */; 753 | sourceTree = BUILT_PRODUCTS_DIR; 754 | }; 755 | 3DAD3EA71DF850E9000B6D8A /* libyoga.a */ = { 756 | isa = PBXReferenceProxy; 757 | fileType = archive.ar; 758 | path = libyoga.a; 759 | remoteRef = 3DAD3EA61DF850E9000B6D8A /* PBXContainerItemProxy */; 760 | sourceTree = BUILT_PRODUCTS_DIR; 761 | }; 762 | 3DAD3EA91DF850E9000B6D8A /* libcxxreact.a */ = { 763 | isa = PBXReferenceProxy; 764 | fileType = archive.ar; 765 | path = libcxxreact.a; 766 | remoteRef = 3DAD3EA81DF850E9000B6D8A /* PBXContainerItemProxy */; 767 | sourceTree = BUILT_PRODUCTS_DIR; 768 | }; 769 | 3DAD3EAB1DF850E9000B6D8A /* libcxxreact.a */ = { 770 | isa = PBXReferenceProxy; 771 | fileType = archive.ar; 772 | path = libcxxreact.a; 773 | remoteRef = 3DAD3EAA1DF850E9000B6D8A /* PBXContainerItemProxy */; 774 | sourceTree = BUILT_PRODUCTS_DIR; 775 | }; 776 | 3DAD3EAD1DF850E9000B6D8A /* libjschelpers.a */ = { 777 | isa = PBXReferenceProxy; 778 | fileType = archive.ar; 779 | path = libjschelpers.a; 780 | remoteRef = 3DAD3EAC1DF850E9000B6D8A /* PBXContainerItemProxy */; 781 | sourceTree = BUILT_PRODUCTS_DIR; 782 | }; 783 | 3DAD3EAF1DF850E9000B6D8A /* libjschelpers.a */ = { 784 | isa = PBXReferenceProxy; 785 | fileType = archive.ar; 786 | path = libjschelpers.a; 787 | remoteRef = 3DAD3EAE1DF850E9000B6D8A /* PBXContainerItemProxy */; 788 | sourceTree = BUILT_PRODUCTS_DIR; 789 | }; 790 | 5E9157331DD0AC6500FF2AA8 /* libRCTAnimation.a */ = { 791 | isa = PBXReferenceProxy; 792 | fileType = archive.ar; 793 | path = libRCTAnimation.a; 794 | remoteRef = 5E9157321DD0AC6500FF2AA8 /* PBXContainerItemProxy */; 795 | sourceTree = BUILT_PRODUCTS_DIR; 796 | }; 797 | 5E9157351DD0AC6500FF2AA8 /* libRCTAnimation.a */ = { 798 | isa = PBXReferenceProxy; 799 | fileType = archive.ar; 800 | path = libRCTAnimation.a; 801 | remoteRef = 5E9157341DD0AC6500FF2AA8 /* PBXContainerItemProxy */; 802 | sourceTree = BUILT_PRODUCTS_DIR; 803 | }; 804 | 78C398B91ACF4ADC00677621 /* libRCTLinking.a */ = { 805 | isa = PBXReferenceProxy; 806 | fileType = archive.ar; 807 | path = libRCTLinking.a; 808 | remoteRef = 78C398B81ACF4ADC00677621 /* PBXContainerItemProxy */; 809 | sourceTree = BUILT_PRODUCTS_DIR; 810 | }; 811 | 832341B51AAA6A8300B99B32 /* libRCTText.a */ = { 812 | isa = PBXReferenceProxy; 813 | fileType = archive.ar; 814 | path = libRCTText.a; 815 | remoteRef = 832341B41AAA6A8300B99B32 /* PBXContainerItemProxy */; 816 | sourceTree = BUILT_PRODUCTS_DIR; 817 | }; 818 | /* End PBXReferenceProxy section */ 819 | 820 | /* Begin PBXResourcesBuildPhase section */ 821 | 13B07F8E1A680F5B00A75B9A /* Resources */ = { 822 | isa = PBXResourcesBuildPhase; 823 | buildActionMask = 2147483647; 824 | files = ( 825 | 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */, 826 | 13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */, 827 | ); 828 | runOnlyForDeploymentPostprocessing = 0; 829 | }; 830 | /* End PBXResourcesBuildPhase section */ 831 | 832 | /* Begin PBXShellScriptBuildPhase section */ 833 | 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */ = { 834 | isa = PBXShellScriptBuildPhase; 835 | buildActionMask = 2147483647; 836 | files = ( 837 | ); 838 | inputPaths = ( 839 | ); 840 | name = "Bundle React Native code and images"; 841 | outputPaths = ( 842 | ); 843 | runOnlyForDeploymentPostprocessing = 0; 844 | shellPath = /bin/sh; 845 | shellScript = "export NODE_BINARY=node\n../node_modules/react-native/scripts/react-native-xcode.sh"; 846 | }; 847 | /* End PBXShellScriptBuildPhase section */ 848 | 849 | /* Begin PBXSourcesBuildPhase section */ 850 | 13B07F871A680F5B00A75B9A /* Sources */ = { 851 | isa = PBXSourcesBuildPhase; 852 | buildActionMask = 2147483647; 853 | files = ( 854 | 13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */, 855 | 13B07FC11A68108700A75B9A /* main.m in Sources */, 856 | ); 857 | runOnlyForDeploymentPostprocessing = 0; 858 | }; 859 | /* End PBXSourcesBuildPhase section */ 860 | 861 | /* Begin PBXVariantGroup section */ 862 | 13B07FB11A68108700A75B9A /* LaunchScreen.xib */ = { 863 | isa = PBXVariantGroup; 864 | children = ( 865 | 13B07FB21A68108700A75B9A /* Base */, 866 | ); 867 | name = LaunchScreen.xib; 868 | path = example; 869 | sourceTree = ""; 870 | }; 871 | /* End PBXVariantGroup section */ 872 | 873 | /* Begin XCBuildConfiguration section */ 874 | 13B07F941A680F5B00A75B9A /* Debug */ = { 875 | isa = XCBuildConfiguration; 876 | buildSettings = { 877 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 878 | CURRENT_PROJECT_VERSION = 1; 879 | DEAD_CODE_STRIPPING = NO; 880 | DEVELOPMENT_TEAM = LYJDLXDTQ5; 881 | HEADER_SEARCH_PATHS = ( 882 | "$(inherited)", 883 | "$(SRCROOT)/../node_modules/react-native-webgl-view-shot/ios/**", 884 | "$(SRCROOT)/../node_modules/react-native-webgl/cpp", 885 | "$(SRCROOT)/../node_modules/react-native-webgl/ios/**", 886 | ); 887 | INFOPLIST_FILE = example/Info.plist; 888 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 889 | OTHER_LDFLAGS = ( 890 | "$(inherited)", 891 | "-ObjC", 892 | "-lc++", 893 | ); 894 | PRODUCT_NAME = example; 895 | VERSIONING_SYSTEM = "apple-generic"; 896 | }; 897 | name = Debug; 898 | }; 899 | 13B07F951A680F5B00A75B9A /* Release */ = { 900 | isa = XCBuildConfiguration; 901 | buildSettings = { 902 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 903 | CURRENT_PROJECT_VERSION = 1; 904 | DEVELOPMENT_TEAM = LYJDLXDTQ5; 905 | HEADER_SEARCH_PATHS = ( 906 | "$(inherited)", 907 | "$(SRCROOT)/../node_modules/react-native-webgl-view-shot/ios/**", 908 | "$(SRCROOT)/../node_modules/react-native-webgl/cpp", 909 | "$(SRCROOT)/../node_modules/react-native-webgl/ios/**", 910 | ); 911 | INFOPLIST_FILE = example/Info.plist; 912 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 913 | OTHER_LDFLAGS = ( 914 | "$(inherited)", 915 | "-ObjC", 916 | "-lc++", 917 | ); 918 | PRODUCT_NAME = example; 919 | VERSIONING_SYSTEM = "apple-generic"; 920 | }; 921 | name = Release; 922 | }; 923 | 83CBBA201A601CBA00E9B192 /* Debug */ = { 924 | isa = XCBuildConfiguration; 925 | buildSettings = { 926 | ALWAYS_SEARCH_USER_PATHS = NO; 927 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 928 | CLANG_CXX_LIBRARY = "libc++"; 929 | CLANG_ENABLE_MODULES = YES; 930 | CLANG_ENABLE_OBJC_ARC = YES; 931 | CLANG_WARN_BOOL_CONVERSION = YES; 932 | CLANG_WARN_CONSTANT_CONVERSION = YES; 933 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 934 | CLANG_WARN_EMPTY_BODY = YES; 935 | CLANG_WARN_ENUM_CONVERSION = YES; 936 | CLANG_WARN_INT_CONVERSION = YES; 937 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 938 | CLANG_WARN_UNREACHABLE_CODE = YES; 939 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 940 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 941 | COPY_PHASE_STRIP = NO; 942 | ENABLE_STRICT_OBJC_MSGSEND = YES; 943 | GCC_C_LANGUAGE_STANDARD = gnu99; 944 | GCC_DYNAMIC_NO_PIC = NO; 945 | GCC_OPTIMIZATION_LEVEL = 0; 946 | GCC_PREPROCESSOR_DEFINITIONS = ( 947 | "DEBUG=1", 948 | "$(inherited)", 949 | ); 950 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 951 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 952 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 953 | GCC_WARN_UNDECLARED_SELECTOR = YES; 954 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 955 | GCC_WARN_UNUSED_FUNCTION = YES; 956 | GCC_WARN_UNUSED_VARIABLE = YES; 957 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 958 | MTL_ENABLE_DEBUG_INFO = YES; 959 | ONLY_ACTIVE_ARCH = YES; 960 | SDKROOT = iphoneos; 961 | }; 962 | name = Debug; 963 | }; 964 | 83CBBA211A601CBA00E9B192 /* Release */ = { 965 | isa = XCBuildConfiguration; 966 | buildSettings = { 967 | ALWAYS_SEARCH_USER_PATHS = NO; 968 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 969 | CLANG_CXX_LIBRARY = "libc++"; 970 | CLANG_ENABLE_MODULES = YES; 971 | CLANG_ENABLE_OBJC_ARC = YES; 972 | CLANG_WARN_BOOL_CONVERSION = YES; 973 | CLANG_WARN_CONSTANT_CONVERSION = YES; 974 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 975 | CLANG_WARN_EMPTY_BODY = YES; 976 | CLANG_WARN_ENUM_CONVERSION = YES; 977 | CLANG_WARN_INT_CONVERSION = YES; 978 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 979 | CLANG_WARN_UNREACHABLE_CODE = YES; 980 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 981 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 982 | COPY_PHASE_STRIP = YES; 983 | ENABLE_NS_ASSERTIONS = NO; 984 | ENABLE_STRICT_OBJC_MSGSEND = YES; 985 | GCC_C_LANGUAGE_STANDARD = gnu99; 986 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 987 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 988 | GCC_WARN_UNDECLARED_SELECTOR = YES; 989 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 990 | GCC_WARN_UNUSED_FUNCTION = YES; 991 | GCC_WARN_UNUSED_VARIABLE = YES; 992 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 993 | MTL_ENABLE_DEBUG_INFO = NO; 994 | SDKROOT = iphoneos; 995 | VALIDATE_PRODUCT = YES; 996 | }; 997 | name = Release; 998 | }; 999 | /* End XCBuildConfiguration section */ 1000 | 1001 | /* Begin XCConfigurationList section */ 1002 | 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "example" */ = { 1003 | isa = XCConfigurationList; 1004 | buildConfigurations = ( 1005 | 13B07F941A680F5B00A75B9A /* Debug */, 1006 | 13B07F951A680F5B00A75B9A /* Release */, 1007 | ); 1008 | defaultConfigurationIsVisible = 0; 1009 | defaultConfigurationName = Release; 1010 | }; 1011 | 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "example" */ = { 1012 | isa = XCConfigurationList; 1013 | buildConfigurations = ( 1014 | 83CBBA201A601CBA00E9B192 /* Debug */, 1015 | 83CBBA211A601CBA00E9B192 /* Release */, 1016 | ); 1017 | defaultConfigurationIsVisible = 0; 1018 | defaultConfigurationName = Release; 1019 | }; 1020 | /* End XCConfigurationList section */ 1021 | }; 1022 | rootObject = 83CBB9F71A601CBA00E9B192 /* Project object */; 1023 | } 1024 | -------------------------------------------------------------------------------- /example/ios/example.xcodeproj/xcshareddata/xcschemes/example-tvOS.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 29 | 35 | 36 | 37 | 43 | 49 | 50 | 51 | 52 | 53 | 58 | 59 | 61 | 67 | 68 | 69 | 70 | 71 | 77 | 78 | 79 | 80 | 81 | 82 | 92 | 94 | 100 | 101 | 102 | 103 | 104 | 105 | 111 | 113 | 119 | 120 | 121 | 122 | 124 | 125 | 128 | 129 | 130 | -------------------------------------------------------------------------------- /example/ios/example.xcodeproj/xcshareddata/xcschemes/example.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 29 | 35 | 36 | 37 | 43 | 49 | 50 | 51 | 52 | 53 | 58 | 59 | 61 | 67 | 68 | 69 | 70 | 71 | 77 | 78 | 79 | 80 | 81 | 82 | 92 | 94 | 100 | 101 | 102 | 103 | 104 | 105 | 111 | 113 | 119 | 120 | 121 | 122 | 124 | 125 | 128 | 129 | 130 | -------------------------------------------------------------------------------- /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 13 | #import 14 | 15 | @implementation AppDelegate 16 | 17 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 18 | { 19 | NSURL *jsCodeLocation; 20 | 21 | jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index.ios" fallbackResource:nil]; 22 | 23 | RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation 24 | moduleName:@"example" 25 | initialProperties:nil 26 | launchOptions:launchOptions]; 27 | rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1]; 28 | 29 | self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; 30 | UIViewController *rootViewController = [UIViewController new]; 31 | rootViewController.view = rootView; 32 | self.window.rootViewController = rootViewController; 33 | [self.window makeKeyAndVisible]; 34 | return YES; 35 | } 36 | 37 | @end 38 | -------------------------------------------------------------------------------- /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 | CFBundleDisplayName 8 | example 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | LSRequiresIPhoneOS 26 | 27 | UILaunchStoryboardName 28 | LaunchScreen 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | UIViewControllerBasedStatusBarAppearance 40 | 41 | NSLocationWhenInUseUsageDescription 42 | 43 | NSAppTransportSecurity 44 | 45 | 46 | NSExceptionDomains 47 | 48 | localhost 49 | 50 | NSExceptionAllowsInsecureHTTPLoads 51 | 52 | 53 | 54 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /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 14 | #import 15 | 16 | #define TIMEOUT_SECONDS 600 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 = [[[RCTSharedApplication() delegate] window] rootViewController]; 41 | NSDate *date = [NSDate dateWithTimeIntervalSinceNow:TIMEOUT_SECONDS]; 42 | BOOL foundElement = NO; 43 | 44 | __block NSString *redboxError = nil; 45 | RCTSetLogFunction(^(RCTLogLevel level, RCTLogSource source, 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.1.0", 4 | "private": true, 5 | "devDependencies": { 6 | "babel-preset-react-native-stage-0": "^1.0.1", 7 | "jest-expo": "~19.0.0", 8 | "react-test-renderer": "16.0.0-alpha.12" 9 | }, 10 | "scripts": { 11 | "start": "react-native start", 12 | "android": "react-native run-android", 13 | "ios": "react-native run-ios" 14 | }, 15 | "dependencies": { 16 | "react": "16.0.0-alpha.12", 17 | "react-native": "^0.47.0", 18 | "react-native-webgl": "^0.3.2", 19 | "react-native-webgl-view-shot": "file:.." 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /ios/RNWebGLTextureView.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import "RNWebGLTexture.h" 3 | #import "GPUImage.h" 4 | 5 | @interface RNWebGLTextureView: RNWebGLTexture 6 | - (instancetype)initWithConfig:(NSDictionary *)config withView:(UIView *)view; 7 | @end 8 | -------------------------------------------------------------------------------- /ios/RNWebGLTextureView.m: -------------------------------------------------------------------------------- 1 | #import 2 | #import "RNWebGLTextureView.h" 3 | #import "GPUImage.h" 4 | 5 | @implementation RNWebGLTextureView { 6 | UIView *view; 7 | GPUImageFilter *filter; 8 | GPUImageTextureOutput *output; 9 | GPUImagePicture *source; 10 | BOOL continuous; 11 | BOOL yflip; 12 | NSTimer *animationTimer; 13 | } 14 | 15 | - (instancetype)initWithConfig:(NSDictionary *)config withView:(UIView *)v { 16 | if ((self = [super initWithConfig:config withWidth:v.bounds.size.width withHeight:v.bounds.size.height])) { 17 | view = v; 18 | continuous = [RCTConvert BOOL:[config objectForKey:@"continuous"]]; 19 | yflip = [RCTConvert BOOL:[config objectForKey:@"yflip"]]; 20 | output = [[GPUImageTextureOutput alloc] init]; 21 | output.delegate = self; 22 | [self snapshot]; 23 | if (continuous) { 24 | animationTimer = 25 | [NSTimer scheduledTimerWithTimeInterval:1.0/60.0 26 | target:self 27 | selector:@selector(snapshot) 28 | userInfo:nil 29 | repeats:YES]; 30 | } 31 | } 32 | return self; 33 | } 34 | 35 | 36 | - (void)unload 37 | { 38 | if (animationTimer) { 39 | [animationTimer invalidate]; 40 | animationTimer = nil; 41 | } 42 | } 43 | 44 | - (void)snapshot { 45 | BOOL success; 46 | CGSize size = view.bounds.size; 47 | UIGraphicsBeginImageContextWithOptions(size, NO, 0); 48 | if (yflip) { 49 | CGAffineTransform flipVertical = CGAffineTransformMake(1, 0, 0, -1, 0, size.height); 50 | CGContextConcatCTM(UIGraphicsGetCurrentContext(), flipVertical); 51 | } 52 | success = [view drawViewHierarchyInRect:(CGRect){CGPointZero, size} afterScreenUpdates:YES]; 53 | UIImage *image = UIGraphicsGetImageFromCurrentImageContext(); 54 | UIGraphicsEndImageContext(); 55 | if (success) { 56 | if (source) { 57 | [source removeAllTargets]; 58 | } 59 | source = [[GPUImagePicture alloc] initWithImage:image]; 60 | [source processImage]; 61 | [source addTarget:output]; 62 | } 63 | } 64 | 65 | - (void)newFrameReadyFromTextureOutput:(GPUImageTextureOutput *)callbackTextureOutput 66 | { 67 | dispatch_async(dispatch_get_main_queue(), ^{ 68 | [self attachTexture:callbackTextureOutput.texture]; 69 | [callbackTextureOutput doneWithTexture]; 70 | }); 71 | } 72 | 73 | 74 | @end 75 | -------------------------------------------------------------------------------- /ios/RNWebGLTextureViewLoader.h: -------------------------------------------------------------------------------- 1 | #import "RNWebGLTextureLoader.h" 2 | 3 | @interface RNWebGLTextureViewLoader : NSObject 4 | @end 5 | -------------------------------------------------------------------------------- /ios/RNWebGLTextureViewLoader.m: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | #import 4 | #import 5 | #import "RNWebGLTextureViewLoader.h" 6 | #import "RNWebGLTextureView.h" 7 | 8 | @implementation RNWebGLTextureViewLoader 9 | 10 | RCT_EXPORT_MODULE() 11 | 12 | @synthesize bridge = _bridge; 13 | 14 | - (BOOL)canLoadConfig:(NSDictionary *)config { 15 | return [config objectForKey:@"view"] != nil; 16 | } 17 | 18 | - (void)loadWithConfig:(NSDictionary *)config 19 | withCompletionBlock:(RNWebGLTextureCompletionBlock)callback { 20 | dispatch_async(RCTGetUIManagerQueue(), ^{ 21 | NSNumber *viewTag = [RCTConvert NSNumber:[config objectForKey:@"view"]]; 22 | [self.bridge.uiManager addUIBlock:^(__unused RCTUIManager *uiManager, NSDictionary *viewRegistry) { 23 | UIView *view = viewRegistry[viewTag]; 24 | if (!view) { 25 | callback([NSError errorWithDomain:@"RNWebGLViewShot" code:1 userInfo:@{ NSLocalizedDescriptionKey: [NSString stringWithFormat:@"No view found with reactTag: %@", viewTag] }], nil); 26 | } 27 | else { 28 | RNWebGLTextureView *obj = [[RNWebGLTextureView alloc] initWithConfig:config withView:view]; 29 | callback(nil, obj); 30 | } 31 | }]; 32 | }); 33 | } 34 | 35 | @end 36 | -------------------------------------------------------------------------------- /ios/RNWebGLViewShot.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 34AE91F81F517EFE007C49C6 /* RNWebGLTextureViewLoader.m in Sources */ = {isa = PBXBuildFile; fileRef = 34AE91F71F517EFE007C49C6 /* RNWebGLTextureViewLoader.m */; }; 11 | 34AE91FC1F51813D007C49C6 /* RNWebGLTextureView.m in Sources */ = {isa = PBXBuildFile; fileRef = 34AE91FB1F51813D007C49C6 /* RNWebGLTextureView.m */; }; 12 | /* End PBXBuildFile section */ 13 | 14 | /* Begin PBXCopyFilesBuildPhase section */ 15 | 58B511D91A9E6C8500147676 /* CopyFiles */ = { 16 | isa = PBXCopyFilesBuildPhase; 17 | buildActionMask = 2147483647; 18 | dstPath = "include/$(PRODUCT_NAME)"; 19 | dstSubfolderSpec = 16; 20 | files = ( 21 | ); 22 | runOnlyForDeploymentPostprocessing = 0; 23 | }; 24 | /* End PBXCopyFilesBuildPhase section */ 25 | 26 | /* Begin PBXFileReference section */ 27 | 134814201AA4EA6300B7C361 /* libRNWebGLViewShot.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRNWebGLViewShot.a; sourceTree = BUILT_PRODUCTS_DIR; }; 28 | 34AE91F71F517EFE007C49C6 /* RNWebGLTextureViewLoader.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RNWebGLTextureViewLoader.m; sourceTree = ""; }; 29 | 34AE91F91F517F2D007C49C6 /* RNWebGLTextureViewLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RNWebGLTextureViewLoader.h; sourceTree = ""; }; 30 | 34AE91FA1F51813D007C49C6 /* RNWebGLTextureView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RNWebGLTextureView.h; sourceTree = ""; }; 31 | 34AE91FB1F51813D007C49C6 /* RNWebGLTextureView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RNWebGLTextureView.m; sourceTree = ""; }; 32 | 34AE92061F5185CA007C49C6 /* libRNWebGL.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libRNWebGL.a; path = "../../../Library/Developer/Xcode/DerivedData/example-evpcihknbipggvaqanjmckojbzak/Build/Products/Debug-iphonesimulator/libRNWebGL.a"; sourceTree = ""; }; 33 | /* End PBXFileReference section */ 34 | 35 | /* Begin PBXFrameworksBuildPhase section */ 36 | 58B511D81A9E6C8500147676 /* Frameworks */ = { 37 | isa = PBXFrameworksBuildPhase; 38 | buildActionMask = 2147483647; 39 | files = ( 40 | ); 41 | runOnlyForDeploymentPostprocessing = 0; 42 | }; 43 | /* End PBXFrameworksBuildPhase section */ 44 | 45 | /* Begin PBXGroup section */ 46 | 134814211AA4EA7D00B7C361 /* Products */ = { 47 | isa = PBXGroup; 48 | children = ( 49 | 134814201AA4EA6300B7C361 /* libRNWebGLViewShot.a */, 50 | ); 51 | name = Products; 52 | sourceTree = ""; 53 | }; 54 | 34AE92051F5185CA007C49C6 /* Frameworks */ = { 55 | isa = PBXGroup; 56 | children = ( 57 | 34AE92061F5185CA007C49C6 /* libRNWebGL.a */, 58 | ); 59 | name = Frameworks; 60 | sourceTree = ""; 61 | }; 62 | 58B511D21A9E6C8500147676 = { 63 | isa = PBXGroup; 64 | children = ( 65 | 34AE91F91F517F2D007C49C6 /* RNWebGLTextureViewLoader.h */, 66 | 34AE91F71F517EFE007C49C6 /* RNWebGLTextureViewLoader.m */, 67 | 34AE91FA1F51813D007C49C6 /* RNWebGLTextureView.h */, 68 | 34AE91FB1F51813D007C49C6 /* RNWebGLTextureView.m */, 69 | 134814211AA4EA7D00B7C361 /* Products */, 70 | 34AE92051F5185CA007C49C6 /* Frameworks */, 71 | ); 72 | indentWidth = 2; 73 | sourceTree = ""; 74 | tabWidth = 2; 75 | }; 76 | /* End PBXGroup section */ 77 | 78 | /* Begin PBXNativeTarget section */ 79 | 58B511DA1A9E6C8500147676 /* RNWebGLViewShot */ = { 80 | isa = PBXNativeTarget; 81 | buildConfigurationList = 58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "RNWebGLViewShot" */; 82 | buildPhases = ( 83 | 58B511D71A9E6C8500147676 /* Sources */, 84 | 58B511D81A9E6C8500147676 /* Frameworks */, 85 | 58B511D91A9E6C8500147676 /* CopyFiles */, 86 | ); 87 | buildRules = ( 88 | ); 89 | dependencies = ( 90 | ); 91 | name = RNWebGLViewShot; 92 | productName = RCTDataManager; 93 | productReference = 134814201AA4EA6300B7C361 /* libRNWebGLViewShot.a */; 94 | productType = "com.apple.product-type.library.static"; 95 | }; 96 | /* End PBXNativeTarget section */ 97 | 98 | /* Begin PBXProject section */ 99 | 58B511D31A9E6C8500147676 /* Project object */ = { 100 | isa = PBXProject; 101 | attributes = { 102 | LastUpgradeCheck = 0610; 103 | ORGANIZATIONNAME = Facebook; 104 | TargetAttributes = { 105 | 58B511DA1A9E6C8500147676 = { 106 | CreatedOnToolsVersion = 6.1.1; 107 | }; 108 | }; 109 | }; 110 | buildConfigurationList = 58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "RNWebGLViewShot" */; 111 | compatibilityVersion = "Xcode 3.2"; 112 | developmentRegion = English; 113 | hasScannedForEncodings = 0; 114 | knownRegions = ( 115 | en, 116 | ); 117 | mainGroup = 58B511D21A9E6C8500147676; 118 | productRefGroup = 58B511D21A9E6C8500147676; 119 | projectDirPath = ""; 120 | projectRoot = ""; 121 | targets = ( 122 | 58B511DA1A9E6C8500147676 /* RNWebGLViewShot */, 123 | ); 124 | }; 125 | /* End PBXProject section */ 126 | 127 | /* Begin PBXSourcesBuildPhase section */ 128 | 58B511D71A9E6C8500147676 /* Sources */ = { 129 | isa = PBXSourcesBuildPhase; 130 | buildActionMask = 2147483647; 131 | files = ( 132 | 34AE91F81F517EFE007C49C6 /* RNWebGLTextureViewLoader.m in Sources */, 133 | 34AE91FC1F51813D007C49C6 /* RNWebGLTextureView.m in Sources */, 134 | ); 135 | runOnlyForDeploymentPostprocessing = 0; 136 | }; 137 | /* End PBXSourcesBuildPhase section */ 138 | 139 | /* Begin XCBuildConfiguration section */ 140 | 58B511ED1A9E6C8500147676 /* Debug */ = { 141 | isa = XCBuildConfiguration; 142 | buildSettings = { 143 | ALWAYS_SEARCH_USER_PATHS = NO; 144 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 145 | CLANG_CXX_LIBRARY = "libc++"; 146 | CLANG_ENABLE_MODULES = YES; 147 | CLANG_ENABLE_OBJC_ARC = YES; 148 | CLANG_WARN_BOOL_CONVERSION = YES; 149 | CLANG_WARN_CONSTANT_CONVERSION = YES; 150 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 151 | CLANG_WARN_EMPTY_BODY = YES; 152 | CLANG_WARN_ENUM_CONVERSION = YES; 153 | CLANG_WARN_INT_CONVERSION = YES; 154 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 155 | CLANG_WARN_UNREACHABLE_CODE = YES; 156 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 157 | COPY_PHASE_STRIP = NO; 158 | ENABLE_STRICT_OBJC_MSGSEND = YES; 159 | GCC_C_LANGUAGE_STANDARD = gnu99; 160 | GCC_DYNAMIC_NO_PIC = NO; 161 | GCC_OPTIMIZATION_LEVEL = 0; 162 | GCC_PREPROCESSOR_DEFINITIONS = ( 163 | "DEBUG=1", 164 | "$(inherited)", 165 | ); 166 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 167 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 168 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 169 | GCC_WARN_UNDECLARED_SELECTOR = YES; 170 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 171 | GCC_WARN_UNUSED_FUNCTION = YES; 172 | GCC_WARN_UNUSED_VARIABLE = YES; 173 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 174 | MTL_ENABLE_DEBUG_INFO = YES; 175 | ONLY_ACTIVE_ARCH = YES; 176 | SDKROOT = iphoneos; 177 | }; 178 | name = Debug; 179 | }; 180 | 58B511EE1A9E6C8500147676 /* Release */ = { 181 | isa = XCBuildConfiguration; 182 | buildSettings = { 183 | ALWAYS_SEARCH_USER_PATHS = NO; 184 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 185 | CLANG_CXX_LIBRARY = "libc++"; 186 | CLANG_ENABLE_MODULES = YES; 187 | CLANG_ENABLE_OBJC_ARC = YES; 188 | CLANG_WARN_BOOL_CONVERSION = YES; 189 | CLANG_WARN_CONSTANT_CONVERSION = YES; 190 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 191 | CLANG_WARN_EMPTY_BODY = YES; 192 | CLANG_WARN_ENUM_CONVERSION = YES; 193 | CLANG_WARN_INT_CONVERSION = YES; 194 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 195 | CLANG_WARN_UNREACHABLE_CODE = YES; 196 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 197 | COPY_PHASE_STRIP = YES; 198 | ENABLE_NS_ASSERTIONS = NO; 199 | ENABLE_STRICT_OBJC_MSGSEND = YES; 200 | GCC_C_LANGUAGE_STANDARD = gnu99; 201 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 202 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 203 | GCC_WARN_UNDECLARED_SELECTOR = YES; 204 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 205 | GCC_WARN_UNUSED_FUNCTION = YES; 206 | GCC_WARN_UNUSED_VARIABLE = YES; 207 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 208 | MTL_ENABLE_DEBUG_INFO = NO; 209 | SDKROOT = iphoneos; 210 | VALIDATE_PRODUCT = YES; 211 | }; 212 | name = Release; 213 | }; 214 | 58B511F01A9E6C8500147676 /* Debug */ = { 215 | isa = XCBuildConfiguration; 216 | buildSettings = { 217 | HEADER_SEARCH_PATHS = ( 218 | "$(inherited)", 219 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, 220 | "$(SRCROOT)/../../../React/**", 221 | "$(SRCROOT)/../../react-native/React/**", 222 | "$(SRCROOT)/../../react-native-webgl/ios/**", 223 | "$(SRCROOT)/../../react-native-webgl/cpp", 224 | ); 225 | LIBRARY_SEARCH_PATHS = "$(inherited)"; 226 | OTHER_LDFLAGS = "-ObjC"; 227 | PRODUCT_NAME = RNWebGLViewShot; 228 | SKIP_INSTALL = YES; 229 | }; 230 | name = Debug; 231 | }; 232 | 58B511F11A9E6C8500147676 /* Release */ = { 233 | isa = XCBuildConfiguration; 234 | buildSettings = { 235 | HEADER_SEARCH_PATHS = ( 236 | "$(inherited)", 237 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, 238 | "$(SRCROOT)/../../../React/**", 239 | "$(SRCROOT)/../../react-native/React/**", 240 | "$(SRCROOT)/../../react-native-webgl/ios/**", 241 | "$(SRCROOT)/../../react-native-webgl/cpp", 242 | ); 243 | LIBRARY_SEARCH_PATHS = "$(inherited)"; 244 | OTHER_LDFLAGS = "-ObjC"; 245 | PRODUCT_NAME = RNWebGLViewShot; 246 | SKIP_INSTALL = YES; 247 | }; 248 | name = Release; 249 | }; 250 | /* End XCBuildConfiguration section */ 251 | 252 | /* Begin XCConfigurationList section */ 253 | 58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "RNWebGLViewShot" */ = { 254 | isa = XCConfigurationList; 255 | buildConfigurations = ( 256 | 58B511ED1A9E6C8500147676 /* Debug */, 257 | 58B511EE1A9E6C8500147676 /* Release */, 258 | ); 259 | defaultConfigurationIsVisible = 0; 260 | defaultConfigurationName = Release; 261 | }; 262 | 58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "RNWebGLViewShot" */ = { 263 | isa = XCConfigurationList; 264 | buildConfigurations = ( 265 | 58B511F01A9E6C8500147676 /* Debug */, 266 | 58B511F11A9E6C8500147676 /* Release */, 267 | ); 268 | defaultConfigurationIsVisible = 0; 269 | defaultConfigurationName = Release; 270 | }; 271 | /* End XCConfigurationList section */ 272 | }; 273 | rootObject = 58B511D31A9E6C8500147676 /* Project object */; 274 | } 275 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "react-native-webgl-view-shot", 3 | "version": "0.1.1", 4 | "description": "React Native WebGL extension to rasterize a view as a GL Texture", 5 | "main": "src/index.js", 6 | "keywords": [ 7 | "react-native", 8 | "react-native-webgl", 9 | "view-shot", 10 | "rasterize" 11 | ], 12 | "author": "Gaëtan Renaudeau ", 13 | "license": "MIT", 14 | "repository": { 15 | "type": "git", 16 | "url": "https://github.com/gre/react-native-webgl-view-shot.git" 17 | }, 18 | "peerDependencies": { 19 | "react": "*", 20 | "react-native": "*", 21 | "react-native-webgl": "*" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/index.js: -------------------------------------------------------------------------------- 1 | //@flow 2 | import React, { Component } from "react"; 3 | import { View, findNodeHandle } from "react-native"; 4 | import { RNExtension } from "react-native-webgl"; 5 | 6 | RNExtension.addMiddleware(ext => ({ 7 | ...ext, 8 | loadTexture: arg => { 9 | if ("view" in arg && typeof arg.view !== "number") { 10 | let refPromise; // it's a promise because we likely need to wait onLayout is ready 11 | if (arg.view instanceof WebGLViewShot) { 12 | refPromise = arg.view.readyRefPromise; 13 | } else { 14 | // assuming another ref was passed, we'll attempt to resolve it 15 | refPromise = Promise.resolve(arg.view); 16 | } 17 | return refPromise.then(ref => { 18 | const view = findNodeHandle(ref); 19 | if (!view) { 20 | throw new Error( 21 | "findNodeHandle failed to resolve view=" + String(ref) 22 | ); 23 | } 24 | return ext.loadTexture({ ...arg, view }); 25 | }); 26 | } else { 27 | // Pass-in the rest 28 | return ext.loadTexture(arg); 29 | } 30 | } 31 | })); 32 | 33 | export default class WebGLViewShot extends Component { 34 | _resolveRef: (ref: *) => void; 35 | readyRefPromise: Promise<*> = new Promise(resolve => { 36 | this._resolveRef = resolve; 37 | }); 38 | onLayout = (e: *) => { 39 | const { onLayout } = this.props; 40 | if (onLayout) onLayout(e); 41 | this._resolveRef(this.refs._root); 42 | }; 43 | render() { 44 | return ( 45 | 51 | ); 52 | } 53 | } 54 | --------------------------------------------------------------------------------