├── .babelrc ├── .buckconfig ├── .eslintrc ├── .flowconfig ├── .gitignore ├── .watchmanconfig ├── README.md ├── android ├── app │ ├── BUCK │ ├── build.gradle │ ├── proguard-rules.pro │ └── src │ │ └── main │ │ ├── AndroidManifest.xml │ │ ├── java │ │ └── com │ │ │ └── reactnativeboilerplate │ │ │ ├── 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 ├── ReactNativeBoilerplate.xcodeproj │ ├── project.pbxproj │ └── xcshareddata │ │ └── xcschemes │ │ └── ReactNativeBoilerplate.xcscheme ├── ReactNativeBoilerplate │ ├── AppDelegate.h │ ├── AppDelegate.m │ ├── Base.lproj │ │ └── LaunchScreen.xib │ ├── Images.xcassets │ │ └── AppIcon.appiconset │ │ │ └── Contents.json │ ├── Info.plist │ └── main.m └── ReactNativeBoilerplateTests │ ├── Info.plist │ └── ReactNativeBoilerplateTests.m ├── package.json ├── src ├── app.js ├── components │ ├── Button.js │ └── TouchableView.js ├── config │ ├── colors.js │ ├── keys.js │ ├── metrics.js │ └── routes.js ├── containers │ ├── AuthScreen │ │ ├── AuthScreen.js │ │ ├── AuthTextInput.js │ │ ├── ForgotForm.js │ │ ├── LoginForm.js │ │ └── SignupForm.js │ ├── MainScreen │ │ └── MainScreen.js │ ├── NavigationRouter │ │ ├── NavBar.android.js │ │ ├── NavBar.ios.js │ │ └── NavigationRouter.js │ └── SplashScreen │ │ └── SplashScreen.js ├── i18n │ ├── en.js │ ├── index.js │ └── it.js ├── images │ └── header.png ├── reducers │ ├── authReducer.js │ ├── authReducer.spec.js │ ├── index.js │ └── navigationReducer.js ├── sagas │ ├── authSagas.js │ ├── authSagas.spec.js │ └── index.js ├── services │ ├── alertHandler.js │ ├── formValidation.js │ └── parseService.js └── store │ └── configureStore.js └── test ├── mocks ├── i18n.js └── parse.js └── setup.js /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": ["react-native"] 3 | } 4 | -------------------------------------------------------------------------------- /.buckconfig: -------------------------------------------------------------------------------- 1 | 2 | [android] 3 | target = Google Inc.:Google APIs:23 4 | 5 | [maven_repositories] 6 | central = https://repo1.maven.org/maven2 7 | -------------------------------------------------------------------------------- /.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "eslint-config-mostaza-react", 3 | "parser": "babel-eslint" 4 | } 5 | -------------------------------------------------------------------------------- /.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 | [include] 13 | 14 | [libs] 15 | node_modules/react-native/Libraries/react-native/react-native-interface.js 16 | node_modules/react-native/flow 17 | flow/ 18 | 19 | [options] 20 | module.system=haste 21 | 22 | esproposal.class_static_fields=enable 23 | esproposal.class_instance_fields=enable 24 | 25 | experimental.strict_type_args=true 26 | 27 | munge_underscores=true 28 | 29 | module.name_mapper='^image![a-zA-Z0-9$_-]+$' -> 'GlobalImageStub' 30 | 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' 31 | 32 | suppress_type=$FlowIssue 33 | suppress_type=$FlowFixMe 34 | suppress_type=$FixMe 35 | 36 | suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(2[0-7]\\|1[0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\) 37 | suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(2[0-7]\\|1[0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+ 38 | suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy 39 | 40 | [version] 41 | ^0.27.0 42 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # OSX 2 | # 3 | .DS_Store 4 | 5 | # Xcode 6 | # 7 | build/ 8 | *.pbxuser 9 | !default.pbxuser 10 | *.mode1v3 11 | !default.mode1v3 12 | *.mode2v3 13 | !default.mode2v3 14 | *.perspectivev3 15 | !default.perspectivev3 16 | xcuserdata 17 | *.xccheckout 18 | *.moved-aside 19 | DerivedData 20 | *.hmap 21 | *.ipa 22 | *.xcuserstate 23 | project.xcworkspace 24 | 25 | # Android/IJ 26 | # 27 | *.iml 28 | .idea 29 | .gradle 30 | local.properties 31 | 32 | # node.js 33 | # 34 | node_modules/ 35 | npm-debug.log 36 | 37 | # BUCK 38 | buck-out/ 39 | \.buckd/ 40 | android/app/libs 41 | android/keystores/debug.keystore 42 | 43 | android/app/src/main/assets/ 44 | .vscode 45 | tsconfig.json 46 | .nyc_output 47 | coverage 48 | *.keystore 49 | *.dSYM.zip 50 | *.mobileprovision 51 | google-play-api-secret.json 52 | 53 | 54 | fastlane/screenshots 55 | *.zip 56 | *.mobileprovision 57 | *.cer 58 | *.certSigningRequest 59 | *.p12 60 | fastlane/report.xml 61 | ios/main.jsbundle 62 | google-play-api-secret.json 63 | -------------------------------------------------------------------------------- /.watchmanconfig: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # What's React-Native Starter? (Work in progress) 2 | React-Native Starter is a boilerplate for a a simple auth flow I use daily. 3 | - Parse-Server as auth backend and the Parse JS SDK for connecting to it (`/services/parseService.js`) 4 | - Redux for state management 5 | - Redux saga for side-effects 6 | - `react-native-i18n` for internationalization 7 | - NavigationExperimental for routing 8 | -------------------------------------------------------------------------------- /android/app/BUCK: -------------------------------------------------------------------------------- 1 | import re 2 | 3 | # To learn about Buck see [Docs](https://buckbuild.com/). 4 | # To run your application with Buck: 5 | # - install Buck 6 | # - `npm start` - to start the packager 7 | # - `cd android` 8 | # - `keytool -genkey -v -keystore keystores/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname "CN=Android Debug,O=Android,C=US` 9 | # - `./gradlew :app:copyDownloadableDepsToLibs` - make all Gradle compile dependencies available to Buck 10 | # - `buck install -r android/app` - compile, install and run application 11 | # 12 | 13 | lib_deps = [] 14 | for jarfile in glob(['libs/*.jar']): 15 | name = 'jars__' + re.sub(r'^.*/([^/]+)\.jar$', r'\1', jarfile) 16 | lib_deps.append(':' + name) 17 | prebuilt_jar( 18 | name = name, 19 | binary_jar = jarfile, 20 | ) 21 | 22 | for aarfile in glob(['libs/*.aar']): 23 | name = 'aars__' + re.sub(r'^.*/([^/]+)\.aar$', r'\1', aarfile) 24 | lib_deps.append(':' + name) 25 | android_prebuilt_aar( 26 | name = name, 27 | aar = aarfile, 28 | ) 29 | 30 | android_library( 31 | name = 'all-libs', 32 | exported_deps = lib_deps 33 | ) 34 | 35 | android_library( 36 | name = 'app-code', 37 | srcs = glob([ 38 | 'src/main/java/**/*.java', 39 | ]), 40 | deps = [ 41 | ':all-libs', 42 | ':build_config', 43 | ':res', 44 | ], 45 | ) 46 | 47 | android_build_config( 48 | name = 'build_config', 49 | package = 'com.reactnativeboilerplate', 50 | ) 51 | 52 | android_resource( 53 | name = 'res', 54 | res = 'src/main/res', 55 | package = 'com.reactnativeboilerplate', 56 | ) 57 | 58 | android_binary( 59 | name = 'app', 60 | package_type = 'debug', 61 | manifest = 'src/main/AndroidManifest.xml', 62 | keystore = '//android/keystores:debug', 63 | deps = [ 64 | ':app-code', 65 | ], 66 | ) 67 | -------------------------------------------------------------------------------- /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 | * // the root of your project, i.e. where "package.json" lives 37 | * root: "../../", 38 | * 39 | * // where to put the JS bundle asset in debug mode 40 | * jsBundleDirDebug: "$buildDir/intermediates/assets/debug", 41 | * 42 | * // where to put the JS bundle asset in release mode 43 | * jsBundleDirRelease: "$buildDir/intermediates/assets/release", 44 | * 45 | * // where to put drawable resources / React Native assets, e.g. the ones you use via 46 | * // require('./image.png')), in debug mode 47 | * resourcesDirDebug: "$buildDir/intermediates/res/merged/debug", 48 | * 49 | * // where to put drawable resources / React Native assets, e.g. the ones you use via 50 | * // require('./image.png')), in release mode 51 | * resourcesDirRelease: "$buildDir/intermediates/res/merged/release", 52 | * 53 | * // by default the gradle tasks are skipped if none of the JS files or assets change; this means 54 | * // that we don't look at files in android/ or ios/ to determine whether the tasks are up to 55 | * // date; if you have any other folders that you want to ignore for performance reasons (gradle 56 | * // indexes the entire tree), add them here. Alternatively, if you have JS files in android/ 57 | * // for example, you might want to remove it from here. 58 | * inputExcludes: ["android/**", "ios/**"], 59 | * 60 | * // override which node gets called and with what additional arguments 61 | * nodeExecutableAndArgs: ["node"] 62 | * 63 | * // supply additional arguments to the packager 64 | * extraPackagerArgs: [] 65 | * ] 66 | */ 67 | 68 | apply from: "../../node_modules/react-native/react.gradle" 69 | 70 | /** 71 | * Set this to true to create two separate APKs instead of one: 72 | * - An APK that only works on ARM devices 73 | * - An APK that only works on x86 devices 74 | * The advantage is the size of the APK is reduced by about 4MB. 75 | * Upload all the APKs to the Play Store and people will download 76 | * the correct one based on the CPU architecture of their device. 77 | */ 78 | def enableSeparateBuildPerCPUArchitecture = false 79 | 80 | /** 81 | * Run Proguard to shrink the Java bytecode in release builds. 82 | */ 83 | def enableProguardInReleaseBuilds = false 84 | 85 | android { 86 | compileSdkVersion 23 87 | buildToolsVersion "23.0.1" 88 | 89 | defaultConfig { 90 | applicationId "com.reactnativeboilerplate" 91 | minSdkVersion 16 92 | targetSdkVersion 22 93 | versionCode 1 94 | versionName "1.0" 95 | ndk { 96 | abiFilters "armeabi-v7a", "x86" 97 | } 98 | } 99 | splits { 100 | abi { 101 | reset() 102 | enable enableSeparateBuildPerCPUArchitecture 103 | universalApk false // If true, also generate a universal APK 104 | include "armeabi-v7a", "x86" 105 | } 106 | } 107 | buildTypes { 108 | release { 109 | minifyEnabled enableProguardInReleaseBuilds 110 | proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro" 111 | } 112 | } 113 | // applicationVariants are e.g. debug, release 114 | applicationVariants.all { variant -> 115 | variant.outputs.each { output -> 116 | // For each separate APK per architecture, set a unique version code as described here: 117 | // http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits 118 | def versionCodes = ["armeabi-v7a":1, "x86":2] 119 | def abi = output.getFilter(OutputFile.ABI) 120 | if (abi != null) { // null for the universal-debug, universal-release variants 121 | output.versionCodeOverride = 122 | versionCodes.get(abi) * 1048576 + defaultConfig.versionCode 123 | } 124 | } 125 | } 126 | } 127 | 128 | dependencies { 129 | compile project(':react-native-vector-icons') 130 | compile project(':react-native-i18n') 131 | compile project(':react-native-code-push') 132 | compile fileTree(dir: "libs", include: ["*.jar"]) 133 | compile "com.android.support:appcompat-v7:23.0.1" 134 | compile "com.facebook.react:react-native:+" // From node_modules 135 | } 136 | 137 | // Run this once to be able to run the application with BUCK 138 | // puts all compile dependencies into folder libs for BUCK to use 139 | task copyDownloadableDepsToLibs(type: Copy) { 140 | from configurations.compile 141 | into 'libs' 142 | } 143 | -------------------------------------------------------------------------------- /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 | # okhttp 54 | 55 | -keepattributes Signature 56 | -keepattributes *Annotation* 57 | -keep class okhttp3.** { *; } 58 | -keep interface okhttp3.** { *; } 59 | -dontwarn okhttp3.** 60 | 61 | # okio 62 | 63 | -keep class sun.misc.Unsafe { *; } 64 | -dontwarn java.nio.file.* 65 | -dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement 66 | -dontwarn okio.** 67 | -------------------------------------------------------------------------------- /android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | 9 | 12 | 13 | 19 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /android/app/src/main/java/com/reactnativeboilerplate/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.reactnativeboilerplate; 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 "ReactNativeBoilerplate"; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /android/app/src/main/java/com/reactnativeboilerplate/MainApplication.java: -------------------------------------------------------------------------------- 1 | package com.reactnativeboilerplate; 2 | 3 | import android.app.Application; 4 | import android.util.Log; 5 | 6 | import com.facebook.react.ReactApplication; 7 | import com.facebook.react.ReactInstanceManager; 8 | import com.facebook.react.ReactNativeHost; 9 | import com.facebook.react.ReactPackage; 10 | import com.facebook.react.shell.MainReactPackage; 11 | 12 | import java.util.Arrays; 13 | import java.util.List; 14 | 15 | import com.oblador.vectoricons.VectorIconsPackage; 16 | import com.i18n.reactnativei18n.ReactNativeI18n; 17 | 18 | public class MainApplication extends Application implements ReactApplication { 19 | 20 | private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) { 21 | @Override 22 | protected boolean getUseDeveloperSupport() { 23 | return BuildConfig.DEBUG; 24 | } 25 | 26 | @Override 27 | protected List getPackages() { 28 | return Arrays.asList( 29 | new MainReactPackage(), 30 | new ReactNativeI18n(), 31 | new VectorIconsPackage() 32 | ); 33 | } 34 | }; 35 | 36 | @Override 37 | public ReactNativeHost getReactNativeHost() { 38 | return mReactNativeHost; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mmazzarolo/react-native-starter/5251e7e35e5a49a90879ce01f9ed1d50e8d1fa6f/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mmazzarolo/react-native-starter/5251e7e35e5a49a90879ce01f9ed1d50e8d1fa6f/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mmazzarolo/react-native-starter/5251e7e35e5a49a90879ce01f9ed1d50e8d1fa6f/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mmazzarolo/react-native-starter/5251e7e35e5a49a90879ce01f9ed1d50e8d1fa6f/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | ReactNativeBoilerplate 6 | 7 | -------------------------------------------------------------------------------- /android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | repositories { 5 | jcenter() 6 | } 7 | dependencies { 8 | classpath 'com.android.tools.build:gradle:1.3.1' 9 | 10 | // NOTE: Do not place your application dependencies here; they belong 11 | // in the individual module build.gradle files 12 | } 13 | } 14 | 15 | allprojects { 16 | repositories { 17 | mavenLocal() 18 | jcenter() 19 | maven { 20 | // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm 21 | url "$rootDir/../node_modules/react-native/android" 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mmazzarolo/react-native-starter/5251e7e35e5a49a90879ce01f9ed1d50e8d1fa6f/android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | zipStoreBase=GRADLE_USER_HOME 4 | zipStorePath=wrapper/dists 5 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.4-all.zip 6 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /android/keystores/BUCK: -------------------------------------------------------------------------------- 1 | keystore( 2 | name = 'debug', 3 | store = 'debug.keystore', 4 | properties = 'debug.keystore.properties', 5 | visibility = [ 6 | 'PUBLIC', 7 | ], 8 | ) 9 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /android/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'ReactNativeBoilerplate' 2 | 3 | include ':app' 4 | include ':react-native-vector-icons' 5 | project(':react-native-vector-icons').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-vector-icons/android') 6 | include ':react-native-i18n' 7 | project(':react-native-i18n').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-i18n/android') 8 | include ':react-native-code-push' 9 | project(':react-native-code-push').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-code-push/android/app') 10 | -------------------------------------------------------------------------------- /index.android.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import { AppRegistry } from 'react-native' 3 | import ReactNativeBoilerplate from './src/app' 4 | 5 | AppRegistry.registerComponent('ReactNativeBoilerplate', () => ReactNativeBoilerplate) 6 | -------------------------------------------------------------------------------- /index.ios.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import { AppRegistry } from 'react-native' 3 | import ReactNativeBoilerplate from './src/app' 4 | 5 | AppRegistry.registerComponent('ReactNativeBoilerplate', () => ReactNativeBoilerplate) 6 | -------------------------------------------------------------------------------- /ios/ReactNativeBoilerplate.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | /* Begin PBXBuildFile section */ 9 | 00C302E51ABCBA2D00DB3ED1 /* libRCTActionSheet.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */; }; 10 | 00C302E71ABCBA2D00DB3ED1 /* libRCTGeolocation.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */; }; 11 | 00C302E81ABCBA2D00DB3ED1 /* libRCTImage.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302C01ABCB91800DB3ED1 /* libRCTImage.a */; }; 12 | 00C302E91ABCBA2D00DB3ED1 /* libRCTNetwork.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302DC1ABCB9D200DB3ED1 /* libRCTNetwork.a */; }; 13 | 00C302EA1ABCBA2D00DB3ED1 /* libRCTVibration.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302E41ABCB9EE00DB3ED1 /* libRCTVibration.a */; }; 14 | 00E356F31AD99517003FC87E /* ReactNativeBoilerplateTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* ReactNativeBoilerplateTests.m */; }; 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 | 140ED2AC1D01E1AD002B40FF /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 146834041AC3E56700842450 /* libReact.a */; }; 23 | 146834051AC3E58100842450 /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 146834041AC3E56700842450 /* libReact.a */; }; 24 | 832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 832341B51AAA6A8300B99B32 /* libRCTText.a */; }; 25 | F2284A29503F47F7A386A6DD /* libRNI18n.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5C46CF0BEF9C444EB4BB2299 /* libRNI18n.a */; }; 26 | FF5284B125EA45E7814308E1 /* libRNVectorIcons.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 7BF9E265233D44B398D992AC /* libRNVectorIcons.a */; }; 27 | C83169EA61A042FCAEF8BCC7 /* Entypo.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 925F963C7A8E427396AC3727 /* Entypo.ttf */; }; 28 | FF769165A9784E588BBE3555 /* EvilIcons.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 74D2C5C566994A97931DB75F /* EvilIcons.ttf */; }; 29 | 127FAFCEA0EC4058B2411C78 /* FontAwesome.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 3A0A88DA4C934EB5A9BADB54 /* FontAwesome.ttf */; }; 30 | 45C966C5B89041F8AD0F1494 /* Foundation.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 0DE46C36BB124F9CBFDDBC68 /* Foundation.ttf */; }; 31 | 7B869DA28F7B4F41A33F20C8 /* Ionicons.ttf in Resources */ = {isa = PBXBuildFile; fileRef = E402502403E14400B4AE3B56 /* Ionicons.ttf */; }; 32 | F0DEACF98DCF42899DFC682C /* MaterialIcons.ttf in Resources */ = {isa = PBXBuildFile; fileRef = BBA8D3E4C53F4B8CBB802A7D /* MaterialIcons.ttf */; }; 33 | 02DA6B8DDEBC4AD282B01B4E /* Octicons.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 9D7B9BE69FF44D39B14D74F1 /* Octicons.ttf */; }; 34 | 7D44B50A8898444984BFC99F /* Zocial.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 306346220E6947E7AA5C35F2 /* Zocial.ttf */; }; 35 | /* End PBXBuildFile section */ 36 | 37 | /* Begin PBXContainerItemProxy section */ 38 | 00C302AB1ABCB8CE00DB3ED1 /* PBXContainerItemProxy */ = { 39 | isa = PBXContainerItemProxy; 40 | containerPortal = 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */; 41 | proxyType = 2; 42 | remoteGlobalIDString = 134814201AA4EA6300B7C361; 43 | remoteInfo = RCTActionSheet; 44 | }; 45 | 00C302B91ABCB90400DB3ED1 /* PBXContainerItemProxy */ = { 46 | isa = PBXContainerItemProxy; 47 | containerPortal = 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */; 48 | proxyType = 2; 49 | remoteGlobalIDString = 134814201AA4EA6300B7C361; 50 | remoteInfo = RCTGeolocation; 51 | }; 52 | 00C302BF1ABCB91800DB3ED1 /* PBXContainerItemProxy */ = { 53 | isa = PBXContainerItemProxy; 54 | containerPortal = 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */; 55 | proxyType = 2; 56 | remoteGlobalIDString = 58B5115D1A9E6B3D00147676; 57 | remoteInfo = RCTImage; 58 | }; 59 | 00C302DB1ABCB9D200DB3ED1 /* PBXContainerItemProxy */ = { 60 | isa = PBXContainerItemProxy; 61 | containerPortal = 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */; 62 | proxyType = 2; 63 | remoteGlobalIDString = 58B511DB1A9E6C8500147676; 64 | remoteInfo = RCTNetwork; 65 | }; 66 | 00C302E31ABCB9EE00DB3ED1 /* PBXContainerItemProxy */ = { 67 | isa = PBXContainerItemProxy; 68 | containerPortal = 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */; 69 | proxyType = 2; 70 | remoteGlobalIDString = 832C81801AAF6DEF007FA2F7; 71 | remoteInfo = RCTVibration; 72 | }; 73 | 00E356F41AD99517003FC87E /* PBXContainerItemProxy */ = { 74 | isa = PBXContainerItemProxy; 75 | containerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */; 76 | proxyType = 1; 77 | remoteGlobalIDString = 13B07F861A680F5B00A75B9A; 78 | remoteInfo = ReactNativeBoilerplate; 79 | }; 80 | 139105C01AF99BAD00B5F7CC /* PBXContainerItemProxy */ = { 81 | isa = PBXContainerItemProxy; 82 | containerPortal = 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */; 83 | proxyType = 2; 84 | remoteGlobalIDString = 134814201AA4EA6300B7C361; 85 | remoteInfo = RCTSettings; 86 | }; 87 | 139FDEF31B06529B00C62182 /* PBXContainerItemProxy */ = { 88 | isa = PBXContainerItemProxy; 89 | containerPortal = 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */; 90 | proxyType = 2; 91 | remoteGlobalIDString = 3C86DF461ADF2C930047B81A; 92 | remoteInfo = RCTWebSocket; 93 | }; 94 | 146834031AC3E56700842450 /* PBXContainerItemProxy */ = { 95 | isa = PBXContainerItemProxy; 96 | containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */; 97 | proxyType = 2; 98 | remoteGlobalIDString = 83CBBA2E1A601D0E00E9B192; 99 | remoteInfo = React; 100 | }; 101 | 78C398B81ACF4ADC00677621 /* PBXContainerItemProxy */ = { 102 | isa = PBXContainerItemProxy; 103 | containerPortal = 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */; 104 | proxyType = 2; 105 | remoteGlobalIDString = 134814201AA4EA6300B7C361; 106 | remoteInfo = RCTLinking; 107 | }; 108 | 832341B41AAA6A8300B99B32 /* PBXContainerItemProxy */ = { 109 | isa = PBXContainerItemProxy; 110 | containerPortal = 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */; 111 | proxyType = 2; 112 | remoteGlobalIDString = 58B5119B1A9E6C1200147676; 113 | remoteInfo = RCTText; 114 | }; 115 | /* End PBXContainerItemProxy section */ 116 | 117 | /* Begin PBXFileReference section */ 118 | 008F07F21AC5B25A0029DE68 /* main.jsbundle */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = main.jsbundle; path = main.jsbundle; sourceTree = ""; }; 119 | 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTActionSheet.xcodeproj; path = ../node_modules/react-native/Libraries/ActionSheetIOS/RCTActionSheet.xcodeproj; sourceTree = ""; }; 120 | 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTGeolocation.xcodeproj; path = ../node_modules/react-native/Libraries/Geolocation/RCTGeolocation.xcodeproj; sourceTree = ""; }; 121 | 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTImage.xcodeproj; path = ../node_modules/react-native/Libraries/Image/RCTImage.xcodeproj; sourceTree = ""; }; 122 | 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTNetwork.xcodeproj; path = ../node_modules/react-native/Libraries/Network/RCTNetwork.xcodeproj; sourceTree = ""; }; 123 | 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTVibration.xcodeproj; path = ../node_modules/react-native/Libraries/Vibration/RCTVibration.xcodeproj; sourceTree = ""; }; 124 | 00E356EE1AD99517003FC87E /* ReactNativeBoilerplateTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ReactNativeBoilerplateTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 125 | 00E356F11AD99517003FC87E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 126 | 00E356F21AD99517003FC87E /* ReactNativeBoilerplateTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ReactNativeBoilerplateTests.m; sourceTree = ""; }; 127 | 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTSettings.xcodeproj; path = ../node_modules/react-native/Libraries/Settings/RCTSettings.xcodeproj; sourceTree = ""; }; 128 | 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTWebSocket.xcodeproj; path = ../node_modules/react-native/Libraries/WebSocket/RCTWebSocket.xcodeproj; sourceTree = ""; }; 129 | 13B07F961A680F5B00A75B9A /* ReactNativeBoilerplate.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ReactNativeBoilerplate.app; sourceTree = BUILT_PRODUCTS_DIR; }; 130 | 13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = ReactNativeBoilerplate/AppDelegate.h; sourceTree = ""; }; 131 | 13B07FB01A68108700A75B9A /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AppDelegate.m; path = ReactNativeBoilerplate/AppDelegate.m; sourceTree = ""; }; 132 | 13B07FB21A68108700A75B9A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; 133 | 13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = ReactNativeBoilerplate/Images.xcassets; sourceTree = ""; }; 134 | 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = ReactNativeBoilerplate/Info.plist; sourceTree = ""; }; 135 | 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = ReactNativeBoilerplate/main.m; sourceTree = ""; }; 136 | 146833FF1AC3E56700842450 /* React.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = React.xcodeproj; path = ../node_modules/react-native/React/React.xcodeproj; sourceTree = ""; }; 137 | 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTLinking.xcodeproj; path = ../node_modules/react-native/Libraries/LinkingIOS/RCTLinking.xcodeproj; sourceTree = ""; }; 138 | 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTText.xcodeproj; path = ../node_modules/react-native/Libraries/Text/RCTText.xcodeproj; sourceTree = ""; }; 139 | 5702558E4D1A4DDE99EE1933 /* RNI18n.xcodeproj */ = {isa = PBXFileReference; name = "RNI18n.xcodeproj"; path = "../node_modules/react-native-i18n/RNI18n.xcodeproj"; sourceTree = ""; fileEncoding = undefined; lastKnownFileType = wrapper.pb-project; explicitFileType = undefined; includeInIndex = 0; }; 140 | 5C46CF0BEF9C444EB4BB2299 /* libRNI18n.a */ = {isa = PBXFileReference; name = "libRNI18n.a"; path = "libRNI18n.a"; sourceTree = ""; fileEncoding = undefined; lastKnownFileType = archive.ar; explicitFileType = undefined; includeInIndex = 0; }; 141 | AB0CB0D83546481C96741FF7 /* RNVectorIcons.xcodeproj */ = {isa = PBXFileReference; name = "RNVectorIcons.xcodeproj"; path = "../node_modules/react-native-vector-icons/RNVectorIcons.xcodeproj"; sourceTree = ""; fileEncoding = undefined; lastKnownFileType = wrapper.pb-project; explicitFileType = undefined; includeInIndex = 0; }; 142 | 7BF9E265233D44B398D992AC /* libRNVectorIcons.a */ = {isa = PBXFileReference; name = "libRNVectorIcons.a"; path = "libRNVectorIcons.a"; sourceTree = ""; fileEncoding = undefined; lastKnownFileType = archive.ar; explicitFileType = undefined; includeInIndex = 0; }; 143 | 925F963C7A8E427396AC3727 /* Entypo.ttf */ = {isa = PBXFileReference; name = "Entypo.ttf"; path = "../node_modules/react-native-vector-icons/Fonts/Entypo.ttf"; sourceTree = ""; fileEncoding = undefined; lastKnownFileType = unknown; explicitFileType = undefined; includeInIndex = 0; }; 144 | 74D2C5C566994A97931DB75F /* EvilIcons.ttf */ = {isa = PBXFileReference; name = "EvilIcons.ttf"; path = "../node_modules/react-native-vector-icons/Fonts/EvilIcons.ttf"; sourceTree = ""; fileEncoding = undefined; lastKnownFileType = unknown; explicitFileType = undefined; includeInIndex = 0; }; 145 | 3A0A88DA4C934EB5A9BADB54 /* FontAwesome.ttf */ = {isa = PBXFileReference; name = "FontAwesome.ttf"; path = "../node_modules/react-native-vector-icons/Fonts/FontAwesome.ttf"; sourceTree = ""; fileEncoding = undefined; lastKnownFileType = unknown; explicitFileType = undefined; includeInIndex = 0; }; 146 | 0DE46C36BB124F9CBFDDBC68 /* Foundation.ttf */ = {isa = PBXFileReference; name = "Foundation.ttf"; path = "../node_modules/react-native-vector-icons/Fonts/Foundation.ttf"; sourceTree = ""; fileEncoding = undefined; lastKnownFileType = unknown; explicitFileType = undefined; includeInIndex = 0; }; 147 | E402502403E14400B4AE3B56 /* Ionicons.ttf */ = {isa = PBXFileReference; name = "Ionicons.ttf"; path = "../node_modules/react-native-vector-icons/Fonts/Ionicons.ttf"; sourceTree = ""; fileEncoding = undefined; lastKnownFileType = unknown; explicitFileType = undefined; includeInIndex = 0; }; 148 | BBA8D3E4C53F4B8CBB802A7D /* MaterialIcons.ttf */ = {isa = PBXFileReference; name = "MaterialIcons.ttf"; path = "../node_modules/react-native-vector-icons/Fonts/MaterialIcons.ttf"; sourceTree = ""; fileEncoding = undefined; lastKnownFileType = unknown; explicitFileType = undefined; includeInIndex = 0; }; 149 | 9D7B9BE69FF44D39B14D74F1 /* Octicons.ttf */ = {isa = PBXFileReference; name = "Octicons.ttf"; path = "../node_modules/react-native-vector-icons/Fonts/Octicons.ttf"; sourceTree = ""; fileEncoding = undefined; lastKnownFileType = unknown; explicitFileType = undefined; includeInIndex = 0; }; 150 | 306346220E6947E7AA5C35F2 /* Zocial.ttf */ = {isa = PBXFileReference; name = "Zocial.ttf"; path = "../node_modules/react-native-vector-icons/Fonts/Zocial.ttf"; sourceTree = ""; fileEncoding = undefined; lastKnownFileType = unknown; explicitFileType = undefined; includeInIndex = 0; }; 151 | /* End PBXFileReference section */ 152 | 153 | /* Begin PBXFrameworksBuildPhase section */ 154 | 00E356EB1AD99517003FC87E /* Frameworks */ = { 155 | isa = PBXFrameworksBuildPhase; 156 | buildActionMask = 2147483647; 157 | files = ( 158 | 140ED2AC1D01E1AD002B40FF /* libReact.a in Frameworks */, 159 | ); 160 | runOnlyForDeploymentPostprocessing = 0; 161 | }; 162 | 13B07F8C1A680F5B00A75B9A /* Frameworks */ = { 163 | isa = PBXFrameworksBuildPhase; 164 | buildActionMask = 2147483647; 165 | files = ( 166 | 146834051AC3E58100842450 /* libReact.a in Frameworks */, 167 | 00C302E51ABCBA2D00DB3ED1 /* libRCTActionSheet.a in Frameworks */, 168 | 00C302E71ABCBA2D00DB3ED1 /* libRCTGeolocation.a in Frameworks */, 169 | 00C302E81ABCBA2D00DB3ED1 /* libRCTImage.a in Frameworks */, 170 | 133E29F31AD74F7200F7D852 /* libRCTLinking.a in Frameworks */, 171 | 00C302E91ABCBA2D00DB3ED1 /* libRCTNetwork.a in Frameworks */, 172 | 139105C61AF99C1200B5F7CC /* libRCTSettings.a in Frameworks */, 173 | 832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */, 174 | 00C302EA1ABCBA2D00DB3ED1 /* libRCTVibration.a in Frameworks */, 175 | 139FDEF61B0652A700C62182 /* libRCTWebSocket.a in Frameworks */, 176 | F2284A29503F47F7A386A6DD /* libRNI18n.a in Frameworks */, 177 | FF5284B125EA45E7814308E1 /* libRNVectorIcons.a in Frameworks */, 178 | ); 179 | runOnlyForDeploymentPostprocessing = 0; 180 | }; 181 | /* End PBXFrameworksBuildPhase section */ 182 | 183 | /* Begin PBXGroup section */ 184 | 00C302A81ABCB8CE00DB3ED1 /* Products */ = { 185 | isa = PBXGroup; 186 | children = ( 187 | 00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */, 188 | ); 189 | name = Products; 190 | sourceTree = ""; 191 | }; 192 | 00C302B61ABCB90400DB3ED1 /* Products */ = { 193 | isa = PBXGroup; 194 | children = ( 195 | 00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */, 196 | ); 197 | name = Products; 198 | sourceTree = ""; 199 | }; 200 | 00C302BC1ABCB91800DB3ED1 /* Products */ = { 201 | isa = PBXGroup; 202 | children = ( 203 | 00C302C01ABCB91800DB3ED1 /* libRCTImage.a */, 204 | ); 205 | name = Products; 206 | sourceTree = ""; 207 | }; 208 | 00C302D41ABCB9D200DB3ED1 /* Products */ = { 209 | isa = PBXGroup; 210 | children = ( 211 | 00C302DC1ABCB9D200DB3ED1 /* libRCTNetwork.a */, 212 | ); 213 | name = Products; 214 | sourceTree = ""; 215 | }; 216 | 00C302E01ABCB9EE00DB3ED1 /* Products */ = { 217 | isa = PBXGroup; 218 | children = ( 219 | 00C302E41ABCB9EE00DB3ED1 /* libRCTVibration.a */, 220 | ); 221 | name = Products; 222 | sourceTree = ""; 223 | }; 224 | 00E356EF1AD99517003FC87E /* ReactNativeBoilerplateTests */ = { 225 | isa = PBXGroup; 226 | children = ( 227 | 00E356F21AD99517003FC87E /* ReactNativeBoilerplateTests.m */, 228 | 00E356F01AD99517003FC87E /* Supporting Files */, 229 | ); 230 | path = ReactNativeBoilerplateTests; 231 | sourceTree = ""; 232 | }; 233 | 00E356F01AD99517003FC87E /* Supporting Files */ = { 234 | isa = PBXGroup; 235 | children = ( 236 | 00E356F11AD99517003FC87E /* Info.plist */, 237 | ); 238 | name = "Supporting Files"; 239 | sourceTree = ""; 240 | }; 241 | 139105B71AF99BAD00B5F7CC /* Products */ = { 242 | isa = PBXGroup; 243 | children = ( 244 | 139105C11AF99BAD00B5F7CC /* libRCTSettings.a */, 245 | ); 246 | name = Products; 247 | sourceTree = ""; 248 | }; 249 | 139FDEE71B06529A00C62182 /* Products */ = { 250 | isa = PBXGroup; 251 | children = ( 252 | 139FDEF41B06529B00C62182 /* libRCTWebSocket.a */, 253 | ); 254 | name = Products; 255 | sourceTree = ""; 256 | }; 257 | 13B07FAE1A68108700A75B9A /* ReactNativeBoilerplate */ = { 258 | isa = PBXGroup; 259 | children = ( 260 | 008F07F21AC5B25A0029DE68 /* main.jsbundle */, 261 | 13B07FAF1A68108700A75B9A /* AppDelegate.h */, 262 | 13B07FB01A68108700A75B9A /* AppDelegate.m */, 263 | 13B07FB51A68108700A75B9A /* Images.xcassets */, 264 | 13B07FB61A68108700A75B9A /* Info.plist */, 265 | 13B07FB11A68108700A75B9A /* LaunchScreen.xib */, 266 | 13B07FB71A68108700A75B9A /* main.m */, 267 | ); 268 | name = ReactNativeBoilerplate; 269 | sourceTree = ""; 270 | }; 271 | 146834001AC3E56700842450 /* Products */ = { 272 | isa = PBXGroup; 273 | children = ( 274 | 146834041AC3E56700842450 /* libReact.a */, 275 | ); 276 | name = Products; 277 | sourceTree = ""; 278 | }; 279 | 78C398B11ACF4ADC00677621 /* Products */ = { 280 | isa = PBXGroup; 281 | children = ( 282 | 78C398B91ACF4ADC00677621 /* libRCTLinking.a */, 283 | ); 284 | name = Products; 285 | sourceTree = ""; 286 | }; 287 | 832341AE1AAA6A7D00B99B32 /* Libraries */ = { 288 | isa = PBXGroup; 289 | children = ( 290 | 146833FF1AC3E56700842450 /* React.xcodeproj */, 291 | 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */, 292 | 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */, 293 | 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */, 294 | 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */, 295 | 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */, 296 | 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */, 297 | 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */, 298 | 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */, 299 | 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */, 300 | 5702558E4D1A4DDE99EE1933 /* RNI18n.xcodeproj */, 301 | AB0CB0D83546481C96741FF7 /* RNVectorIcons.xcodeproj */, 302 | ); 303 | name = Libraries; 304 | sourceTree = ""; 305 | }; 306 | 832341B11AAA6A8300B99B32 /* Products */ = { 307 | isa = PBXGroup; 308 | children = ( 309 | 832341B51AAA6A8300B99B32 /* libRCTText.a */, 310 | ); 311 | name = Products; 312 | sourceTree = ""; 313 | }; 314 | 83CBB9F61A601CBA00E9B192 = { 315 | isa = PBXGroup; 316 | children = ( 317 | 13B07FAE1A68108700A75B9A /* ReactNativeBoilerplate */, 318 | 832341AE1AAA6A7D00B99B32 /* Libraries */, 319 | 00E356EF1AD99517003FC87E /* ReactNativeBoilerplateTests */, 320 | 83CBBA001A601CBA00E9B192 /* Products */, 321 | 316DB137F1564659B4413FFA /* Resources */, 322 | ); 323 | indentWidth = 2; 324 | sourceTree = ""; 325 | tabWidth = 2; 326 | }; 327 | 83CBBA001A601CBA00E9B192 /* Products */ = { 328 | isa = PBXGroup; 329 | children = ( 330 | 13B07F961A680F5B00A75B9A /* ReactNativeBoilerplate.app */, 331 | 00E356EE1AD99517003FC87E /* ReactNativeBoilerplateTests.xctest */, 332 | ); 333 | name = Products; 334 | sourceTree = ""; 335 | }; 336 | 316DB137F1564659B4413FFA /* Resources */ = { 337 | isa = PBXGroup; 338 | children = ( 339 | 925F963C7A8E427396AC3727 /* Entypo.ttf */, 340 | 74D2C5C566994A97931DB75F /* EvilIcons.ttf */, 341 | 3A0A88DA4C934EB5A9BADB54 /* FontAwesome.ttf */, 342 | 0DE46C36BB124F9CBFDDBC68 /* Foundation.ttf */, 343 | E402502403E14400B4AE3B56 /* Ionicons.ttf */, 344 | BBA8D3E4C53F4B8CBB802A7D /* MaterialIcons.ttf */, 345 | 9D7B9BE69FF44D39B14D74F1 /* Octicons.ttf */, 346 | 306346220E6947E7AA5C35F2 /* Zocial.ttf */, 347 | ); 348 | name = Resources; 349 | path = ""; 350 | sourceTree = ""; 351 | }; 352 | /* End PBXGroup section */ 353 | 354 | /* Begin PBXNativeTarget section */ 355 | 00E356ED1AD99517003FC87E /* ReactNativeBoilerplateTests */ = { 356 | isa = PBXNativeTarget; 357 | buildConfigurationList = 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "ReactNativeBoilerplateTests" */; 358 | buildPhases = ( 359 | 00E356EA1AD99517003FC87E /* Sources */, 360 | 00E356EB1AD99517003FC87E /* Frameworks */, 361 | 00E356EC1AD99517003FC87E /* Resources */, 362 | ); 363 | buildRules = ( 364 | ); 365 | dependencies = ( 366 | 00E356F51AD99517003FC87E /* PBXTargetDependency */, 367 | ); 368 | name = ReactNativeBoilerplateTests; 369 | productName = ReactNativeBoilerplateTests; 370 | productReference = 00E356EE1AD99517003FC87E /* ReactNativeBoilerplateTests.xctest */; 371 | productType = "com.apple.product-type.bundle.unit-test"; 372 | }; 373 | 13B07F861A680F5B00A75B9A /* ReactNativeBoilerplate */ = { 374 | isa = PBXNativeTarget; 375 | buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "ReactNativeBoilerplate" */; 376 | buildPhases = ( 377 | 13B07F871A680F5B00A75B9A /* Sources */, 378 | 13B07F8C1A680F5B00A75B9A /* Frameworks */, 379 | 13B07F8E1A680F5B00A75B9A /* Resources */, 380 | 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */, 381 | ); 382 | buildRules = ( 383 | ); 384 | dependencies = ( 385 | ); 386 | name = ReactNativeBoilerplate; 387 | productName = "Hello World"; 388 | productReference = 13B07F961A680F5B00A75B9A /* ReactNativeBoilerplate.app */; 389 | productType = "com.apple.product-type.application"; 390 | }; 391 | /* End PBXNativeTarget section */ 392 | 393 | /* Begin PBXProject section */ 394 | 83CBB9F71A601CBA00E9B192 /* Project object */ = { 395 | isa = PBXProject; 396 | attributes = { 397 | LastUpgradeCheck = 610; 398 | ORGANIZATIONNAME = Facebook; 399 | TargetAttributes = { 400 | 00E356ED1AD99517003FC87E = { 401 | CreatedOnToolsVersion = 6.2; 402 | TestTargetID = 13B07F861A680F5B00A75B9A; 403 | }; 404 | }; 405 | }; 406 | buildConfigurationList = 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "ReactNativeBoilerplate" */; 407 | compatibilityVersion = "Xcode 3.2"; 408 | developmentRegion = English; 409 | hasScannedForEncodings = 0; 410 | knownRegions = ( 411 | en, 412 | Base, 413 | ); 414 | mainGroup = 83CBB9F61A601CBA00E9B192; 415 | productRefGroup = 83CBBA001A601CBA00E9B192 /* Products */; 416 | projectDirPath = ""; 417 | projectReferences = ( 418 | { 419 | ProductGroup = 00C302A81ABCB8CE00DB3ED1 /* Products */; 420 | ProjectRef = 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */; 421 | }, 422 | { 423 | ProductGroup = 00C302B61ABCB90400DB3ED1 /* Products */; 424 | ProjectRef = 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */; 425 | }, 426 | { 427 | ProductGroup = 00C302BC1ABCB91800DB3ED1 /* Products */; 428 | ProjectRef = 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */; 429 | }, 430 | { 431 | ProductGroup = 78C398B11ACF4ADC00677621 /* Products */; 432 | ProjectRef = 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */; 433 | }, 434 | { 435 | ProductGroup = 00C302D41ABCB9D200DB3ED1 /* Products */; 436 | ProjectRef = 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */; 437 | }, 438 | { 439 | ProductGroup = 139105B71AF99BAD00B5F7CC /* Products */; 440 | ProjectRef = 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */; 441 | }, 442 | { 443 | ProductGroup = 832341B11AAA6A8300B99B32 /* Products */; 444 | ProjectRef = 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */; 445 | }, 446 | { 447 | ProductGroup = 00C302E01ABCB9EE00DB3ED1 /* Products */; 448 | ProjectRef = 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */; 449 | }, 450 | { 451 | ProductGroup = 139FDEE71B06529A00C62182 /* Products */; 452 | ProjectRef = 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */; 453 | }, 454 | { 455 | ProductGroup = 146834001AC3E56700842450 /* Products */; 456 | ProjectRef = 146833FF1AC3E56700842450 /* React.xcodeproj */; 457 | }, 458 | ); 459 | projectRoot = ""; 460 | targets = ( 461 | 13B07F861A680F5B00A75B9A /* ReactNativeBoilerplate */, 462 | 00E356ED1AD99517003FC87E /* ReactNativeBoilerplateTests */, 463 | ); 464 | }; 465 | /* End PBXProject section */ 466 | 467 | /* Begin PBXReferenceProxy section */ 468 | 00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */ = { 469 | isa = PBXReferenceProxy; 470 | fileType = archive.ar; 471 | path = libRCTActionSheet.a; 472 | remoteRef = 00C302AB1ABCB8CE00DB3ED1 /* PBXContainerItemProxy */; 473 | sourceTree = BUILT_PRODUCTS_DIR; 474 | }; 475 | 00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */ = { 476 | isa = PBXReferenceProxy; 477 | fileType = archive.ar; 478 | path = libRCTGeolocation.a; 479 | remoteRef = 00C302B91ABCB90400DB3ED1 /* PBXContainerItemProxy */; 480 | sourceTree = BUILT_PRODUCTS_DIR; 481 | }; 482 | 00C302C01ABCB91800DB3ED1 /* libRCTImage.a */ = { 483 | isa = PBXReferenceProxy; 484 | fileType = archive.ar; 485 | path = libRCTImage.a; 486 | remoteRef = 00C302BF1ABCB91800DB3ED1 /* PBXContainerItemProxy */; 487 | sourceTree = BUILT_PRODUCTS_DIR; 488 | }; 489 | 00C302DC1ABCB9D200DB3ED1 /* libRCTNetwork.a */ = { 490 | isa = PBXReferenceProxy; 491 | fileType = archive.ar; 492 | path = libRCTNetwork.a; 493 | remoteRef = 00C302DB1ABCB9D200DB3ED1 /* PBXContainerItemProxy */; 494 | sourceTree = BUILT_PRODUCTS_DIR; 495 | }; 496 | 00C302E41ABCB9EE00DB3ED1 /* libRCTVibration.a */ = { 497 | isa = PBXReferenceProxy; 498 | fileType = archive.ar; 499 | path = libRCTVibration.a; 500 | remoteRef = 00C302E31ABCB9EE00DB3ED1 /* PBXContainerItemProxy */; 501 | sourceTree = BUILT_PRODUCTS_DIR; 502 | }; 503 | 139105C11AF99BAD00B5F7CC /* libRCTSettings.a */ = { 504 | isa = PBXReferenceProxy; 505 | fileType = archive.ar; 506 | path = libRCTSettings.a; 507 | remoteRef = 139105C01AF99BAD00B5F7CC /* PBXContainerItemProxy */; 508 | sourceTree = BUILT_PRODUCTS_DIR; 509 | }; 510 | 139FDEF41B06529B00C62182 /* libRCTWebSocket.a */ = { 511 | isa = PBXReferenceProxy; 512 | fileType = archive.ar; 513 | path = libRCTWebSocket.a; 514 | remoteRef = 139FDEF31B06529B00C62182 /* PBXContainerItemProxy */; 515 | sourceTree = BUILT_PRODUCTS_DIR; 516 | }; 517 | 146834041AC3E56700842450 /* libReact.a */ = { 518 | isa = PBXReferenceProxy; 519 | fileType = archive.ar; 520 | path = libReact.a; 521 | remoteRef = 146834031AC3E56700842450 /* PBXContainerItemProxy */; 522 | sourceTree = BUILT_PRODUCTS_DIR; 523 | }; 524 | 78C398B91ACF4ADC00677621 /* libRCTLinking.a */ = { 525 | isa = PBXReferenceProxy; 526 | fileType = archive.ar; 527 | path = libRCTLinking.a; 528 | remoteRef = 78C398B81ACF4ADC00677621 /* PBXContainerItemProxy */; 529 | sourceTree = BUILT_PRODUCTS_DIR; 530 | }; 531 | 832341B51AAA6A8300B99B32 /* libRCTText.a */ = { 532 | isa = PBXReferenceProxy; 533 | fileType = archive.ar; 534 | path = libRCTText.a; 535 | remoteRef = 832341B41AAA6A8300B99B32 /* PBXContainerItemProxy */; 536 | sourceTree = BUILT_PRODUCTS_DIR; 537 | }; 538 | /* End PBXReferenceProxy section */ 539 | 540 | /* Begin PBXResourcesBuildPhase section */ 541 | 00E356EC1AD99517003FC87E /* Resources */ = { 542 | isa = PBXResourcesBuildPhase; 543 | buildActionMask = 2147483647; 544 | files = ( 545 | ); 546 | runOnlyForDeploymentPostprocessing = 0; 547 | }; 548 | 13B07F8E1A680F5B00A75B9A /* Resources */ = { 549 | isa = PBXResourcesBuildPhase; 550 | buildActionMask = 2147483647; 551 | files = ( 552 | 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */, 553 | 13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */, 554 | C83169EA61A042FCAEF8BCC7 /* Entypo.ttf in Resources */, 555 | FF769165A9784E588BBE3555 /* EvilIcons.ttf in Resources */, 556 | 127FAFCEA0EC4058B2411C78 /* FontAwesome.ttf in Resources */, 557 | 45C966C5B89041F8AD0F1494 /* Foundation.ttf in Resources */, 558 | 7B869DA28F7B4F41A33F20C8 /* Ionicons.ttf in Resources */, 559 | F0DEACF98DCF42899DFC682C /* MaterialIcons.ttf in Resources */, 560 | 02DA6B8DDEBC4AD282B01B4E /* Octicons.ttf in Resources */, 561 | 7D44B50A8898444984BFC99F /* Zocial.ttf in Resources */, 562 | ); 563 | runOnlyForDeploymentPostprocessing = 0; 564 | }; 565 | /* End PBXResourcesBuildPhase section */ 566 | 567 | /* Begin PBXShellScriptBuildPhase section */ 568 | 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */ = { 569 | isa = PBXShellScriptBuildPhase; 570 | buildActionMask = 2147483647; 571 | files = ( 572 | ); 573 | inputPaths = ( 574 | ); 575 | name = "Bundle React Native code and images"; 576 | outputPaths = ( 577 | ); 578 | runOnlyForDeploymentPostprocessing = 0; 579 | shellPath = /bin/sh; 580 | shellScript = "export NODE_BINARY=node\n../node_modules/react-native/packager/react-native-xcode.sh"; 581 | showEnvVarsInLog = 1; 582 | }; 583 | /* End PBXShellScriptBuildPhase section */ 584 | 585 | /* Begin PBXSourcesBuildPhase section */ 586 | 00E356EA1AD99517003FC87E /* Sources */ = { 587 | isa = PBXSourcesBuildPhase; 588 | buildActionMask = 2147483647; 589 | files = ( 590 | 00E356F31AD99517003FC87E /* ReactNativeBoilerplateTests.m in Sources */, 591 | ); 592 | runOnlyForDeploymentPostprocessing = 0; 593 | }; 594 | 13B07F871A680F5B00A75B9A /* Sources */ = { 595 | isa = PBXSourcesBuildPhase; 596 | buildActionMask = 2147483647; 597 | files = ( 598 | 13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */, 599 | 13B07FC11A68108700A75B9A /* main.m in Sources */, 600 | ); 601 | runOnlyForDeploymentPostprocessing = 0; 602 | }; 603 | /* End PBXSourcesBuildPhase section */ 604 | 605 | /* Begin PBXTargetDependency section */ 606 | 00E356F51AD99517003FC87E /* PBXTargetDependency */ = { 607 | isa = PBXTargetDependency; 608 | target = 13B07F861A680F5B00A75B9A /* ReactNativeBoilerplate */; 609 | targetProxy = 00E356F41AD99517003FC87E /* PBXContainerItemProxy */; 610 | }; 611 | /* End PBXTargetDependency section */ 612 | 613 | /* Begin PBXVariantGroup section */ 614 | 13B07FB11A68108700A75B9A /* LaunchScreen.xib */ = { 615 | isa = PBXVariantGroup; 616 | children = ( 617 | 13B07FB21A68108700A75B9A /* Base */, 618 | ); 619 | name = LaunchScreen.xib; 620 | path = ReactNativeBoilerplate; 621 | sourceTree = ""; 622 | }; 623 | /* End PBXVariantGroup section */ 624 | 625 | /* Begin XCBuildConfiguration section */ 626 | 00E356F61AD99517003FC87E /* Debug */ = { 627 | isa = XCBuildConfiguration; 628 | buildSettings = { 629 | BUNDLE_LOADER = "$(TEST_HOST)"; 630 | GCC_PREPROCESSOR_DEFINITIONS = ( 631 | "DEBUG=1", 632 | "$(inherited)", 633 | ); 634 | INFOPLIST_FILE = ReactNativeBoilerplateTests/Info.plist; 635 | IPHONEOS_DEPLOYMENT_TARGET = 8.2; 636 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 637 | PRODUCT_NAME = "$(TARGET_NAME)"; 638 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ReactNativeBoilerplate.app/ReactNativeBoilerplate"; 639 | LIBRARY_SEARCH_PATHS = ( 640 | "$(inherited)", 641 | "\"$(SRCROOT)/$(TARGET_NAME)\"", 642 | "\"$(SRCROOT)/$(TARGET_NAME)\"", 643 | ); 644 | }; 645 | name = Debug; 646 | }; 647 | 00E356F71AD99517003FC87E /* Release */ = { 648 | isa = XCBuildConfiguration; 649 | buildSettings = { 650 | BUNDLE_LOADER = "$(TEST_HOST)"; 651 | COPY_PHASE_STRIP = NO; 652 | INFOPLIST_FILE = ReactNativeBoilerplateTests/Info.plist; 653 | IPHONEOS_DEPLOYMENT_TARGET = 8.2; 654 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 655 | PRODUCT_NAME = "$(TARGET_NAME)"; 656 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ReactNativeBoilerplate.app/ReactNativeBoilerplate"; 657 | LIBRARY_SEARCH_PATHS = ( 658 | "$(inherited)", 659 | "\"$(SRCROOT)/$(TARGET_NAME)\"", 660 | "\"$(SRCROOT)/$(TARGET_NAME)\"", 661 | ); 662 | }; 663 | name = Release; 664 | }; 665 | 13B07F941A680F5B00A75B9A /* Debug */ = { 666 | isa = XCBuildConfiguration; 667 | buildSettings = { 668 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 669 | DEAD_CODE_STRIPPING = NO; 670 | HEADER_SEARCH_PATHS = ( 671 | "$(inherited)", 672 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, 673 | "$(SRCROOT)/../node_modules/react-native/React/**", 674 | "$(SRCROOT)/../node_modules/react-native-i18n/RNI18n", 675 | "$(SRCROOT)/../node_modules/react-native-vector-icons/RNVectorIconsManager", 676 | ); 677 | INFOPLIST_FILE = "ReactNativeBoilerplate/Info.plist"; 678 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 679 | OTHER_LDFLAGS = ( 680 | "$(inherited)", 681 | "-ObjC", 682 | "-lc++", 683 | ); 684 | PRODUCT_NAME = ReactNativeBoilerplate; 685 | }; 686 | name = Debug; 687 | }; 688 | 13B07F951A680F5B00A75B9A /* Release */ = { 689 | isa = XCBuildConfiguration; 690 | buildSettings = { 691 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 692 | HEADER_SEARCH_PATHS = ( 693 | "$(inherited)", 694 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, 695 | "$(SRCROOT)/../node_modules/react-native/React/**", 696 | "$(SRCROOT)/../node_modules/react-native-i18n/RNI18n", 697 | "$(SRCROOT)/../node_modules/react-native-vector-icons/RNVectorIconsManager", 698 | ); 699 | INFOPLIST_FILE = "ReactNativeBoilerplate/Info.plist"; 700 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 701 | OTHER_LDFLAGS = ( 702 | "$(inherited)", 703 | "-ObjC", 704 | "-lc++", 705 | ); 706 | PRODUCT_NAME = ReactNativeBoilerplate; 707 | }; 708 | name = Release; 709 | }; 710 | 83CBBA201A601CBA00E9B192 /* Debug */ = { 711 | isa = XCBuildConfiguration; 712 | buildSettings = { 713 | ALWAYS_SEARCH_USER_PATHS = NO; 714 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 715 | CLANG_CXX_LIBRARY = "libc++"; 716 | CLANG_ENABLE_MODULES = YES; 717 | CLANG_ENABLE_OBJC_ARC = YES; 718 | CLANG_WARN_BOOL_CONVERSION = YES; 719 | CLANG_WARN_CONSTANT_CONVERSION = YES; 720 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 721 | CLANG_WARN_EMPTY_BODY = YES; 722 | CLANG_WARN_ENUM_CONVERSION = YES; 723 | CLANG_WARN_INT_CONVERSION = YES; 724 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 725 | CLANG_WARN_UNREACHABLE_CODE = YES; 726 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 727 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 728 | COPY_PHASE_STRIP = NO; 729 | ENABLE_STRICT_OBJC_MSGSEND = YES; 730 | GCC_C_LANGUAGE_STANDARD = gnu99; 731 | GCC_DYNAMIC_NO_PIC = NO; 732 | GCC_OPTIMIZATION_LEVEL = 0; 733 | GCC_PREPROCESSOR_DEFINITIONS = ( 734 | "DEBUG=1", 735 | "$(inherited)", 736 | ); 737 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 738 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 739 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 740 | GCC_WARN_UNDECLARED_SELECTOR = YES; 741 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 742 | GCC_WARN_UNUSED_FUNCTION = YES; 743 | GCC_WARN_UNUSED_VARIABLE = YES; 744 | HEADER_SEARCH_PATHS = ( 745 | "$(inherited)", 746 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, 747 | "$(SRCROOT)/../node_modules/react-native/React/**", 748 | "$(SRCROOT)/../node_modules/react-native-i18n/RNI18n", 749 | "$(SRCROOT)/../node_modules/react-native-vector-icons/RNVectorIconsManager", 750 | ); 751 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 752 | MTL_ENABLE_DEBUG_INFO = YES; 753 | ONLY_ACTIVE_ARCH = YES; 754 | SDKROOT = iphoneos; 755 | }; 756 | name = Debug; 757 | }; 758 | 83CBBA211A601CBA00E9B192 /* Release */ = { 759 | isa = XCBuildConfiguration; 760 | buildSettings = { 761 | ALWAYS_SEARCH_USER_PATHS = NO; 762 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 763 | CLANG_CXX_LIBRARY = "libc++"; 764 | CLANG_ENABLE_MODULES = YES; 765 | CLANG_ENABLE_OBJC_ARC = YES; 766 | CLANG_WARN_BOOL_CONVERSION = YES; 767 | CLANG_WARN_CONSTANT_CONVERSION = YES; 768 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 769 | CLANG_WARN_EMPTY_BODY = YES; 770 | CLANG_WARN_ENUM_CONVERSION = YES; 771 | CLANG_WARN_INT_CONVERSION = YES; 772 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 773 | CLANG_WARN_UNREACHABLE_CODE = YES; 774 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 775 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 776 | COPY_PHASE_STRIP = YES; 777 | ENABLE_NS_ASSERTIONS = NO; 778 | ENABLE_STRICT_OBJC_MSGSEND = YES; 779 | GCC_C_LANGUAGE_STANDARD = gnu99; 780 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 781 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 782 | GCC_WARN_UNDECLARED_SELECTOR = YES; 783 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 784 | GCC_WARN_UNUSED_FUNCTION = YES; 785 | GCC_WARN_UNUSED_VARIABLE = YES; 786 | HEADER_SEARCH_PATHS = ( 787 | "$(inherited)", 788 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, 789 | "$(SRCROOT)/../node_modules/react-native/React/**", 790 | "$(SRCROOT)/../node_modules/react-native-i18n/RNI18n", 791 | "$(SRCROOT)/../node_modules/react-native-vector-icons/RNVectorIconsManager", 792 | ); 793 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 794 | MTL_ENABLE_DEBUG_INFO = NO; 795 | SDKROOT = iphoneos; 796 | VALIDATE_PRODUCT = YES; 797 | }; 798 | name = Release; 799 | }; 800 | /* End XCBuildConfiguration section */ 801 | 802 | /* Begin XCConfigurationList section */ 803 | 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "ReactNativeBoilerplateTests" */ = { 804 | isa = XCConfigurationList; 805 | buildConfigurations = ( 806 | 00E356F61AD99517003FC87E /* Debug */, 807 | 00E356F71AD99517003FC87E /* Release */, 808 | ); 809 | defaultConfigurationIsVisible = 0; 810 | defaultConfigurationName = Release; 811 | }; 812 | 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "ReactNativeBoilerplate" */ = { 813 | isa = XCConfigurationList; 814 | buildConfigurations = ( 815 | 13B07F941A680F5B00A75B9A /* Debug */, 816 | 13B07F951A680F5B00A75B9A /* Release */, 817 | ); 818 | defaultConfigurationIsVisible = 0; 819 | defaultConfigurationName = Release; 820 | }; 821 | 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "ReactNativeBoilerplate" */ = { 822 | isa = XCConfigurationList; 823 | buildConfigurations = ( 824 | 83CBBA201A601CBA00E9B192 /* Debug */, 825 | 83CBBA211A601CBA00E9B192 /* Release */, 826 | ); 827 | defaultConfigurationIsVisible = 0; 828 | defaultConfigurationName = Release; 829 | }; 830 | /* End XCConfigurationList section */ 831 | }; 832 | rootObject = 83CBB9F71A601CBA00E9B192 /* Project object */; 833 | } 834 | -------------------------------------------------------------------------------- /ios/ReactNativeBoilerplate.xcodeproj/xcshareddata/xcschemes/ReactNativeBoilerplate.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 29 | 35 | 36 | 37 | 38 | 39 | 44 | 45 | 47 | 53 | 54 | 55 | 56 | 57 | 63 | 64 | 65 | 66 | 75 | 77 | 83 | 84 | 85 | 86 | 87 | 88 | 94 | 96 | 102 | 103 | 104 | 105 | 107 | 108 | 111 | 112 | 113 | -------------------------------------------------------------------------------- /ios/ReactNativeBoilerplate/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 | -------------------------------------------------------------------------------- /ios/ReactNativeBoilerplate/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 "RCTBundleURLProvider.h" 13 | #import "RCTRootView.h" 14 | 15 | @implementation AppDelegate 16 | 17 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 18 | { 19 | NSURL *jsCodeLocation; 20 | 21 | [[RCTBundleURLProvider sharedSettings] setDefaults]; 22 | jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index.ios" fallbackResource:nil]; 23 | 24 | RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation 25 | moduleName:@"ReactNativeBoilerplate" 26 | initialProperties:nil 27 | launchOptions:launchOptions]; 28 | rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1]; 29 | 30 | self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; 31 | UIViewController *rootViewController = [UIViewController new]; 32 | rootViewController.view = rootView; 33 | self.window.rootViewController = rootViewController; 34 | [self.window makeKeyAndVisible]; 35 | return YES; 36 | } 37 | 38 | @end 39 | -------------------------------------------------------------------------------- /ios/ReactNativeBoilerplate/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 | -------------------------------------------------------------------------------- /ios/ReactNativeBoilerplate/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 | } -------------------------------------------------------------------------------- /ios/ReactNativeBoilerplate/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 | NSExceptionDomains 44 | 45 | localhost 46 | 47 | NSTemporaryExceptionAllowsInsecureHTTPLoads 48 | 49 | 50 | 51 | 52 | UIAppFonts 53 | 54 | Entypo.ttf 55 | EvilIcons.ttf 56 | FontAwesome.ttf 57 | Foundation.ttf 58 | Ionicons.ttf 59 | MaterialIcons.ttf 60 | Octicons.ttf 61 | Zocial.ttf 62 | 63 | 64 | -------------------------------------------------------------------------------- /ios/ReactNativeBoilerplate/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 | -------------------------------------------------------------------------------- /ios/ReactNativeBoilerplateTests/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 | -------------------------------------------------------------------------------- /ios/ReactNativeBoilerplateTests/ReactNativeBoilerplateTests.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | #import 12 | 13 | #import "RCTLog.h" 14 | #import "RCTRootView.h" 15 | 16 | #define TIMEOUT_SECONDS 600 17 | #define TEXT_TO_LOOK_FOR @"Welcome to React Native!" 18 | 19 | @interface ReactNativeBoilerplateTests : XCTestCase 20 | 21 | @end 22 | 23 | @implementation ReactNativeBoilerplateTests 24 | 25 | - (BOOL)findSubviewInView:(UIView *)view matching:(BOOL(^)(UIView *view))test 26 | { 27 | if (test(view)) { 28 | return YES; 29 | } 30 | for (UIView *subview in [view subviews]) { 31 | if ([self findSubviewInView:subview matching:test]) { 32 | return YES; 33 | } 34 | } 35 | return NO; 36 | } 37 | 38 | - (void)testRendersWelcomeScreen 39 | { 40 | UIViewController *vc = [[[[UIApplication sharedApplication] delegate] window] rootViewController]; 41 | NSDate *date = [NSDate dateWithTimeIntervalSinceNow:TIMEOUT_SECONDS]; 42 | BOOL foundElement = NO; 43 | 44 | __block NSString *redboxError = nil; 45 | RCTSetLogFunction(^(RCTLogLevel level, 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 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ReactNativeBoilerplate", 3 | "version": "0.0.1", 4 | "private": true, 5 | "scripts": { 6 | "start": "node node_modules/react-native/local-cli/cli.js start", 7 | "reset": "watchman watch-del-all && rm -rf node_modules/ && npm cache clean && npm prune && npm i", 8 | "android:build": "cd android && ./gradlew assembleRelease", 9 | "android:install": "cd android && ./gradlew assembleRelease && ./gradlew installRelease", 10 | "android:deploy": "fastlane android alpha", 11 | "android:shake": "$ANDROID_HOME/platform-tools/adb devices | grep '\\t' | awk '{print $1}' | sed 's/\\s//g' | xargs -I {} $ANDROID_HOME/platform-tools/adb -s {} shell input keyevent 82", 12 | "ios:deploy": "fastlane ios alpha", 13 | "lint": "eslint src", 14 | "test": "ava --verbose", 15 | "test:watch": "npm run test -- --watch", 16 | "test:coverage": "nyc npm run test" 17 | }, 18 | "dependencies": { 19 | "babel-eslint": "^6.1.2", 20 | "eslint-plugin-react": "^5.2.2", 21 | "lodash": "^4.14.1", 22 | "parse": "^1.9.0", 23 | "react": "^15.2.0", 24 | "react-native": "^0.30.0", 25 | "react-native-animatable": "^0.6.1", 26 | "react-native-i18n": "0.0.8", 27 | "react-native-vector-icons": "^2.0.3", 28 | "react-redux": "^4.4.5", 29 | "redux": "^3.5.2", 30 | "redux-logger": "^2.6.1", 31 | "redux-saga": "^0.11.0" 32 | }, 33 | "devDependencies": { 34 | "ava": "^0.15.2", 35 | "babel-core": "^6.11.4", 36 | "babel-polyfill": "^6.9.1", 37 | "eslint": "^3.2.0", 38 | "eslint-config-mostaza-react": "^1.0.3", 39 | "eslint-plugin-import": "^1.12.0", 40 | "eslint-plugin-jsx-a11y": "^2.0.1", 41 | "eslint-plugin-react": "^6.0.0", 42 | "fetch-mock": "^5.0.3", 43 | "mockery": "^1.7.0", 44 | "nyc": "^7.1.0", 45 | "proxyquire": "^1.7.10", 46 | "react-native-mock": "^0.2.5", 47 | "sinon": "^1.17.5" 48 | }, 49 | "ava": { 50 | "babel": "inherit", 51 | "files": [ 52 | "src/**/*spec.js" 53 | ], 54 | "require": [ 55 | "babel-register", 56 | "babel-polyfill", 57 | "react-native-mock/mock", 58 | "./test/setup" 59 | ] 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /src/app.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react' 2 | import { StatusBar } from 'react-native' 3 | import { View } from 'react-native-animatable' 4 | import { Provider } from 'react-redux' 5 | import NavigationRouter from './containers/NavigationRouter/NavigationRouter' 6 | import configureStore from './store/configureStore' 7 | import * as colors from './config/colors' 8 | 9 | const store = configureStore() 10 | 11 | export default class ReactNativeBoilerplate extends Component { 12 | render () { 13 | return ( 14 | 15 | 16 | 17 | 18 | 19 | 20 | ) 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/components/Button.js: -------------------------------------------------------------------------------- 1 | import React, { PropTypes } from 'react' 2 | import { ActivityIndicator, StyleSheet } from 'react-native' 3 | import TouchableView from './TouchableView' 4 | import { noop } from 'lodash' 5 | import * as colors from '../config/colors' 6 | 7 | const Button = ({ onPress, isEnabled, isLoading, children, style }) => { 8 | const backgroundColor = isEnabled && !isLoading ? colors.PRIMARY : colors.LIGHT_GREY 9 | const onButtonPress = isEnabled && !isLoading ? onPress : noop 10 | const buttonStyle = [styles.button, { backgroundColor }, style] 11 | const buttonContent = isLoading 12 | ? 13 | : children 14 | 15 | return ( 16 | 17 | {buttonContent} 18 | 19 | ) 20 | } 21 | 22 | Button.propTypes = { 23 | onPress: PropTypes.func, 24 | isEnabled: PropTypes.bool, 25 | isLoading: PropTypes.bool, 26 | children: PropTypes.node.isRequired, 27 | style: PropTypes.any 28 | } 29 | 30 | Button.defaultProps = { 31 | onPress: () => noop, 32 | isEnabled: true, 33 | isLoading: false 34 | } 35 | 36 | const styles = StyleSheet.create({ 37 | button: { 38 | height: 42, 39 | borderWidth: 1, 40 | borderRadius: 1, 41 | alignSelf: 'stretch', 42 | justifyContent: 'center', 43 | borderColor: 'rgba(0, 0, 0, 0.1)' 44 | } 45 | }) 46 | 47 | export default Button 48 | -------------------------------------------------------------------------------- /src/components/TouchableView.js: -------------------------------------------------------------------------------- 1 | import React, { PropTypes } from 'react' 2 | import { Platform, View, TouchableNativeFeedback, TouchableOpacity } from 'react-native' 3 | 4 | const IS_ANDROID = Platform.OS === 'android' 5 | const IS_RIPPLE_EFFECT_SUPPORTED = Platform.Version >= 21 && IS_ANDROID 6 | 7 | const TouchableView = ({ isRippleDisabled, children, style, ...props }) => { 8 | if (IS_RIPPLE_EFFECT_SUPPORTED && !isRippleDisabled) { 9 | const background = TouchableNativeFeedback.Ripple(null, false) 10 | return ( 11 | 12 | {children} 13 | 14 | ) 15 | } else { 16 | return ( 17 | 18 | {children} 19 | 20 | ) 21 | } 22 | } 23 | 24 | TouchableView.propTypes = { 25 | isRippleDisabled: PropTypes.bool, 26 | children: PropTypes.any, 27 | style: View.propTypes.style 28 | } 29 | 30 | export default TouchableView 31 | -------------------------------------------------------------------------------- /src/config/colors.js: -------------------------------------------------------------------------------- 1 | import { Platform } from 'react-native' 2 | 3 | const IS_ANDROID = Platform.OS === 'android' 4 | 5 | export const TEXT_NORMAL = IS_ANDROID ? '#343434' : '#000000' 6 | export const TEXT_LIGHT = 'grey' 7 | export const TEXT_PARAGRAPH = '#7F91A7' 8 | export const FORM_TEXTINPUT_TEXT = IS_ANDROID ? '#343434' : '#000000' 9 | export const FORM_TEXTINPUT_BORDER = '#cccccc' 10 | export const FORM_TEXTINPUT_BACKGROUND = 'white' 11 | export const FORM_TEXTINPUT_ERROR = '#DC143C' 12 | export const PRIMARY = '#048db4' 13 | export const PRIMARY_DARK = '#006d92' 14 | export const PRIMARY_DARKER = '#006d92' 15 | export const PRIMARY_LIGHTER = '#cee1eb' 16 | export const PRIMARY_LIGHTEST = '#EBF3F7' 17 | export const LIGHT_GREY = '#EEEEEE' 18 | export const ALMOST_BLACK = '#33383D' 19 | -------------------------------------------------------------------------------- /src/config/keys.js: -------------------------------------------------------------------------------- 1 | export const PARSE_SERVER_URL = 'YOUR_PARSE_SERVER_URL' 2 | export const PARSE_APP_ID = 'YOUR_PARSE_APP_ID' 3 | -------------------------------------------------------------------------------- /src/config/metrics.js: -------------------------------------------------------------------------------- 1 | import { Dimensions, Platform } from 'react-native' 2 | 3 | const IS_ANDROID = Platform.OS === 'android' 4 | const { height, width } = Dimensions.get('window') 5 | 6 | export const ANDROID_STATUSBAR = 24 7 | export const DEVICE_HEIGHT = IS_ANDROID ? height - 24 : height 8 | export const DEVICE_WIDTH = width 9 | export const NAVBAR_HEIGHT = IS_ANDROID ? 54 : 64 10 | -------------------------------------------------------------------------------- /src/config/routes.js: -------------------------------------------------------------------------------- 1 | export const splashScreen = { 2 | key: 'splashScreen', 3 | title: 'SCREEN_TITLE_SPLASH', 4 | hideNavBar: true 5 | } 6 | 7 | export const authScreen = { 8 | key: 'authScreen', 9 | title: 'SCREEN_TITLE_AUTH', 10 | hideNavBar: true 11 | } 12 | 13 | export const mainScreen = { 14 | key: 'mainScreen', 15 | title: 'SCREEN_TITLE_MAIN_SCREEN' 16 | } 17 | -------------------------------------------------------------------------------- /src/containers/AuthScreen/AuthScreen.js: -------------------------------------------------------------------------------- 1 | import React, { Component, PropTypes } from 'react' 2 | import { Keyboard, LayoutAnimation, Platform, StyleSheet } from 'react-native' 3 | import { Image, View } from 'react-native-animatable' 4 | import { connect } from 'react-redux' 5 | import { bindActionCreators } from 'redux' 6 | import { actionCreators } from '../../reducers/authReducer' 7 | import LoginForm from './LoginForm' 8 | import SignupForm from './SignupForm' 9 | import ForgotForm from './ForgotForm' 10 | import * as metrics from '../../config/metrics' 11 | import headerImg from '../../images/header.png' 12 | 13 | const IS_ANDROID = Platform.OS === 'android' 14 | 15 | const mapStateToProps = (state, ownProps) => ({ 16 | user: state.auth.user, 17 | isLoading: state.auth.isLoading 18 | }) 19 | 20 | const mapDispatchToProps = (dispatch) => ({ 21 | ...bindActionCreators(actionCreators, dispatch) 22 | }) 23 | 24 | export class AuthScreen extends Component { 25 | static propTypes = { 26 | user: PropTypes.object, 27 | isLoading: PropTypes.bool, 28 | login: PropTypes.func.isRequired, 29 | signup: PropTypes.func.isRequired, 30 | resetPassword: PropTypes.func.isRequired 31 | } 32 | 33 | state = { 34 | visibleForm: 'LOGIN', 35 | containerHeight: metrics.DEVICE_HEIGHT, 36 | headerHeight: metrics.DEVICE_HEIGHT / 2 37 | } 38 | 39 | componentWillMount () { 40 | if (!IS_ANDROID) { 41 | Keyboard.addListener('keyboardWillShow', this._handleKeyboardShow) 42 | Keyboard.addListener('keyboardWillHide', this._handleKeyboardHide) 43 | } 44 | } 45 | 46 | componentDidMount () { 47 | this.refs.headerImg.rubberBand(1000) 48 | this.refs.form.fadeIn(1000) 49 | } 50 | 51 | componentWillUnmount () { 52 | if (!IS_ANDROID) { 53 | Keyboard.removeAllListeners('keyboardWillShow') 54 | Keyboard.removeAllListeners('keyboardWillHide') 55 | } 56 | } 57 | 58 | _handleKeyboardShow = (e) => { 59 | LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut) 60 | const containerHeight = metrics.DEVICE_HEIGHT - e.endCoordinates.height 61 | const headerHeight = (metrics.DEVICE_HEIGHT / 2) - e.endCoordinates.height 62 | this.setState({ containerHeight, headerHeight }) 63 | } 64 | 65 | _handleKeyboardHide = () => { 66 | LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut) 67 | const containerHeight = metrics.DEVICE_HEIGHT 68 | const headerHeight = metrics.DEVICE_HEIGHT / 2 69 | this.setState({ containerHeight, headerHeight }) 70 | } 71 | 72 | _setVisibleForm = async (visibleForm) => { 73 | await this.refs.form.fadeOut(400) 74 | this.setState({ visibleForm }) 75 | await this.refs.form.fadeIn(400) 76 | } 77 | 78 | _renderForm = () => { 79 | const { isLoading, signup, login, resetPassword } = this.props 80 | switch (this.state.visibleForm) { 81 | case 'SIGNUP': 82 | return ( 83 | this._setVisibleForm('LOGIN')} 87 | /> 88 | ) 89 | case 'LOGIN': 90 | return ( 91 | this._setVisibleForm('SIGNUP')} 95 | onForgotLinkPress={() => this._setVisibleForm('FORGOT')} 96 | /> 97 | ) 98 | case 'FORGOT': 99 | return ( 100 | this._setVisibleForm('SIGNUP')} 104 | onLoginLinkPress={() => this._setVisibleForm('LOGIN')} 105 | /> 106 | ) 107 | default: return null 108 | } 109 | } 110 | 111 | render () { 112 | const { containerHeight, headerHeight } = this.state 113 | 114 | return ( 115 | 116 | 122 | 123 | 124 | 125 | {this._renderForm()} 126 | 127 | 128 | 129 | ) 130 | } 131 | } 132 | 133 | const styles = StyleSheet.create({ 134 | headerImg: { 135 | position: 'absolute', 136 | top: 30, 137 | left: 30, 138 | width: metrics.DEVICE_WIDTH - 60, 139 | resizeMode: 'contain' 140 | }, 141 | container: { 142 | flex: 1, 143 | justifyContent: 'space-between' 144 | } 145 | }) 146 | 147 | export default connect(mapStateToProps, mapDispatchToProps)(AuthScreen) 148 | -------------------------------------------------------------------------------- /src/containers/AuthScreen/AuthTextInput.js: -------------------------------------------------------------------------------- 1 | import React, { Component, PropTypes } from 'react' 2 | import { Platform, StyleSheet, TextInput } from 'react-native' 3 | import { Text, View } from 'react-native-animatable' 4 | import Icon from 'react-native-vector-icons/Ionicons' 5 | import i18n from '../../i18n' 6 | import * as colors from '../../config/colors' 7 | 8 | const IS_ANDROID = Platform.OS === 'android' 9 | 10 | export default class LoginForm extends Component { 11 | static propTypes = { 12 | showForgotLink: PropTypes.bool, 13 | onForgotPress: PropTypes.func, 14 | iconName: PropTypes.string, 15 | errorText: PropTypes.string 16 | } 17 | 18 | focus = () => this.refs.textInput.focus() 19 | 20 | render () { 21 | const { showForgotLink, onForgotPress, iconName, errorText } = this.props 22 | const forgotLink = ( 23 | 24 | {i18n.t('AUTH_FORGOT_BUTTON')} 25 | 26 | ) 27 | return ( 28 | 29 | 30 | 37 | 46 | {showForgotLink ? forgotLink : null} 47 | 48 | {errorText} 49 | 50 | ) 51 | } 52 | } 53 | 54 | const styles = StyleSheet.create({ 55 | container: { 56 | }, 57 | textInputWrapper: { 58 | alignItems: 'center', 59 | flexDirection: 'row', 60 | height: 42, 61 | borderRadius: 4, 62 | marginTop: 10, 63 | borderColor: colors.FORM_TEXTINPUT_BORDER, 64 | backgroundColor: colors.FORM_TEXTINPUT_BACKGROUND, 65 | borderWidth: 1, 66 | paddingHorizontal: 16 67 | }, 68 | icon: { 69 | paddingRight: 8 70 | }, 71 | forgotLink: { 72 | fontWeight: 'normal', 73 | color: colors.FORM_TEXTINPUT_TEXT 74 | }, 75 | textInput: { 76 | flex: 1, 77 | color: colors.FORM_TEXTINPUT_TEXT, 78 | margin: IS_ANDROID ? -1 : 0, 79 | height: 42, 80 | padding: 7 81 | }, 82 | errorText: { 83 | color: colors.FORM_TEXTINPUT_ERROR, 84 | height: 18, 85 | marginLeft: 16 86 | } 87 | }) 88 | -------------------------------------------------------------------------------- /src/containers/AuthScreen/ForgotForm.js: -------------------------------------------------------------------------------- 1 | import React, { Component, PropTypes } from 'react' 2 | import { StyleSheet } from 'react-native' 3 | import { Text, View } from 'react-native-animatable' 4 | import i18n from '../../i18n' 5 | import Button from '../../components/Button' 6 | import AuthTextInput from './AuthTextInput' 7 | import * as metrics from '../../config/metrics' 8 | import * as colors from '../../config/colors' 9 | import * as formValidation from '../../services/formValidation' 10 | 11 | export default class ForgotForm extends Component { 12 | static propTypes = { 13 | isLoading: PropTypes.bool, 14 | onForgotPress: PropTypes.func.isRequired, 15 | onLoginLinkPress: PropTypes.func.isRequired, 16 | onSignupLinkPress: PropTypes.func.isRequired, 17 | style: PropTypes.any 18 | } 19 | 20 | state = { 21 | email: '', 22 | emailError: '' 23 | } 24 | 25 | _handleChangeEmail = (email) => { 26 | const emailError = formValidation.validateEmail(email) 27 | ? '' 28 | : i18n.t('AUTH_INVALID_EMAIL') 29 | this.setState({ email, emailError }) 30 | } 31 | 32 | _handleForgotPress = () => { 33 | const { onForgotPress } = this.props 34 | const { email } = this.state 35 | onForgotPress(email) 36 | } 37 | 38 | render () { 39 | const { isLoading, onLoginLinkPress, onSignupLinkPress, style } = this.props 40 | const { email, emailError } = this.state 41 | const isValid = emailError === '' && email !== '' 42 | return ( 43 | 44 | 45 | this.refs.password.focus()} 57 | onChangeText={this._handleChangeEmail} 58 | /> 59 | 67 | 68 | 69 | 70 | {i18n.t('AUTH_LOGIN_BUTTON')} 71 | 72 | 73 | {i18n.t('AUTH_SIGNUP_BUTTON')} 74 | 75 | 76 | 77 | ) 78 | } 79 | } 80 | 81 | const styles = StyleSheet.create({ 82 | container: { 83 | height: metrics.DEVICE_HEIGHT / 2, 84 | justifyContent: 'space-between', 85 | padding: 28 86 | }, 87 | button: { 88 | marginTop: 20 89 | }, 90 | buttonText: { 91 | textAlign: 'center', 92 | color: 'white' 93 | }, 94 | bottomTextContainer: { 95 | flexDirection: 'row', 96 | justifyContent: 'space-between' 97 | }, 98 | signupText: { 99 | color: colors.PRIMARY 100 | } 101 | }) 102 | -------------------------------------------------------------------------------- /src/containers/AuthScreen/LoginForm.js: -------------------------------------------------------------------------------- 1 | import React, { Component, PropTypes } from 'react' 2 | import { StyleSheet } from 'react-native' 3 | import { Text, View } from 'react-native-animatable' 4 | import Button from '../../components/Button' 5 | import AuthTextInput from './AuthTextInput' 6 | import i18n from '../../i18n' 7 | import * as metrics from '../../config/metrics' 8 | import * as colors from '../../config/colors' 9 | import * as formValidation from '../../services/formValidation' 10 | 11 | export default class LoginForm extends Component { 12 | static propTypes = { 13 | isLoading: PropTypes.bool, 14 | onLoginPress: PropTypes.func.isRequired, 15 | onSignupLinkPress: PropTypes.func.isRequired, 16 | onForgotLinkPress: PropTypes.func.isRequired, 17 | style: PropTypes.any 18 | } 19 | 20 | state = { 21 | email: '', 22 | emailError: '', 23 | password: '' 24 | } 25 | 26 | _handleChangeEmail = (email) => { 27 | const emailError = formValidation.validateEmail(email) 28 | ? '' 29 | : i18n.t('AUTH_INVALID_EMAIL') 30 | this.setState({ email, emailError }) 31 | } 32 | 33 | _handleChangePassword = (password) => { 34 | this.setState({ password }) 35 | } 36 | 37 | _handleLoginPress = () => { 38 | const { onLoginPress } = this.props 39 | const { email, password } = this.state 40 | onLoginPress(email, password) 41 | } 42 | 43 | render () { 44 | const { isLoading, onSignupLinkPress, onForgotLinkPress, style } = this.props 45 | const { email, emailError, password } = this.state 46 | const isValid = emailError === '' && email !== '' && password !== '' 47 | return ( 48 | 49 | 50 | this.refs.password.focus()} 62 | onChangeText={this._handleChangeEmail} 63 | /> 64 | 77 | 85 | 86 | 87 | {i18n.t('AUTH_NO_ACCOUNT')}{' '} 88 | 89 | {i18n.t('AUTH_SIGNUP_BUTTON')} 90 | 91 | 92 | 93 | ) 94 | } 95 | } 96 | 97 | const styles = StyleSheet.create({ 98 | container: { 99 | height: metrics.DEVICE_HEIGHT / 2, 100 | justifyContent: 'space-between', 101 | padding: 28 102 | }, 103 | button: { 104 | marginTop: 20 105 | }, 106 | buttonText: { 107 | textAlign: 'center', 108 | color: 'white' 109 | }, 110 | bottomTextContainer: { 111 | flexDirection: 'row', 112 | justifyContent: 'center' 113 | }, 114 | signupText: { 115 | color: colors.PRIMARY 116 | } 117 | }) 118 | -------------------------------------------------------------------------------- /src/containers/AuthScreen/SignupForm.js: -------------------------------------------------------------------------------- 1 | import React, { Component, PropTypes } from 'react' 2 | import { StyleSheet } from 'react-native' 3 | import { Text, View } from 'react-native-animatable' 4 | import i18n from '../../i18n' 5 | import Button from '../../components/Button' 6 | import AuthTextInput from './AuthTextInput' 7 | import * as metrics from '../../config/metrics' 8 | import * as colors from '../../config/colors' 9 | import * as formValidation from '../../services/formValidation' 10 | 11 | export default class SignupForm extends Component { 12 | static propTypes = { 13 | isLoading: PropTypes.bool, 14 | onSignupPress: PropTypes.func.isRequired, 15 | onLoginLinkPress: PropTypes.func.isRequired, 16 | style: PropTypes.any 17 | } 18 | 19 | state = { 20 | email: '', 21 | emailError: '', 22 | password: '', 23 | passwordError: '' 24 | } 25 | 26 | _handleChangeEmail = (email) => { 27 | const emailError = formValidation.validateEmail(email) 28 | ? '' 29 | : i18n.t('AUTH_INVALID_EMAIL') 30 | this.setState({ email, emailError }) 31 | } 32 | 33 | _handleChangePassword = (password) => { 34 | const passwordError = formValidation.validatePassword(password) 35 | ? '' 36 | : i18n.t('AUTH_INVALID_PASSWORD') 37 | this.setState({ password, passwordError }) 38 | } 39 | 40 | _handleSignupPress = () => { 41 | const { onSignupPress } = this.props 42 | const { email, password } = this.state 43 | onSignupPress(email, password) 44 | } 45 | 46 | render () { 47 | const { isLoading, onLoginLinkPress, style } = this.props 48 | const { email, emailError, password, passwordError } = this.state 49 | const isValid = emailError === '' && passwordError === '' && email !== '' && password !== '' 50 | return ( 51 | 52 | 53 | this.refs.password.focus()} 65 | onChangeText={this._handleChangeEmail} 66 | /> 67 | 78 | 86 | 87 | 88 | {i18n.t('AUTH_ALREADY_REGISTERED')}{' '} 89 | 90 | {i18n.t('AUTH_LOGIN_BUTTON')} 91 | 92 | 93 | 94 | ) 95 | } 96 | } 97 | 98 | const styles = StyleSheet.create({ 99 | container: { 100 | height: metrics.DEVICE_HEIGHT / 2, 101 | justifyContent: 'space-between', 102 | padding: 28 103 | }, 104 | button: { 105 | marginTop: 20 106 | }, 107 | buttonText: { 108 | textAlign: 'center', 109 | color: 'white' 110 | }, 111 | bottomTextContainer: { 112 | flexDirection: 'row', 113 | justifyContent: 'center' 114 | }, 115 | signupText: { 116 | color: colors.PRIMARY 117 | } 118 | }) 119 | -------------------------------------------------------------------------------- /src/containers/MainScreen/MainScreen.js: -------------------------------------------------------------------------------- 1 | import React, { Component, PropTypes } from 'react' 2 | import { StyleSheet, Text, View } from 'react-native' 3 | import { connect } from 'react-redux' 4 | import { bindActionCreators } from 'redux' 5 | import { actionCreators as authActionCreators } from '../../reducers/authReducer' 6 | import Button from '../../components/Button' 7 | 8 | const mapStateToProps = (state, ownProps) => ({ 9 | user: state.auth.user 10 | }) 11 | 12 | const mapDispatchToProps = (dispatch) => ({ 13 | ...bindActionCreators(authActionCreators, dispatch), 14 | dispatch 15 | }) 16 | 17 | export class MainScreen extends Component { 18 | static propTypes = { 19 | user: PropTypes.object, 20 | logout: PropTypes.func.isRequired 21 | } 22 | 23 | static defaultProps = { 24 | user: {} 25 | } 26 | 27 | render () { 28 | const welcomeText = this.props.user 29 | ? {`Welcome ${this.props.user.username}!`} 30 | : null 31 | 32 | return ( 33 | 34 | {welcomeText} 35 | 38 | 39 | ) 40 | } 41 | } 42 | 43 | const styles = StyleSheet.create({ 44 | container: { 45 | flex: 1, 46 | justifyContent: 'center', 47 | alignItems: 'center' 48 | }, 49 | welcomeText: { 50 | textAlign: 'center' 51 | }, 52 | button: { 53 | margin: 60 54 | }, 55 | buttonText: { 56 | textAlign: 'center', 57 | color: 'white' 58 | } 59 | }) 60 | 61 | export default connect(mapStateToProps, mapDispatchToProps)(MainScreen) 62 | -------------------------------------------------------------------------------- /src/containers/NavigationRouter/NavBar.android.js: -------------------------------------------------------------------------------- 1 | import React, { Component, PropTypes } from 'react' 2 | import { StyleSheet } from 'react-native' 3 | import { noop } from 'lodash' 4 | import * as colors from '../../config/colors' 5 | import * as metrics from '../../config/metrics' 6 | import Icon from 'react-native-vector-icons/Ionicons' 7 | 8 | export default class NavBar extends Component { 9 | static propTypes = { 10 | title: PropTypes.string, 11 | onLeftPress: PropTypes.func, 12 | onRightPress: PropTypes.func, 13 | leftIcon: React.PropTypes.string, 14 | rightImage: React.PropTypes.string 15 | } 16 | 17 | static defaultProps = { 18 | title: 'Hello world', 19 | onLeftPress: noop, 20 | onRightPress: noop, 21 | leftIcon: 'md-arrow-back' 22 | } 23 | 24 | render () { 25 | const { title, onLeftPress, onRightPress, leftIcon, rightImage } = this.props 26 | const actions = rightImage ? [{ title: '', icon: rightImage, show: 'always' }] : undefined 27 | return ( 28 | 37 | ) 38 | } 39 | } 40 | 41 | const styles = StyleSheet.create({ 42 | toolbar: { 43 | backgroundColor: colors.PRIMARY, 44 | height: metrics.NAVBAR_HEIGHT, 45 | position: 'absolute', top: 0, left: 0, width: metrics.DEVICE_WIDTH // TO-DO 46 | } 47 | }) 48 | -------------------------------------------------------------------------------- /src/containers/NavigationRouter/NavBar.ios.js: -------------------------------------------------------------------------------- 1 | import React, { Component, PropTypes } from 'react' 2 | import { Image, NavigationExperimental, StyleSheet } from 'react-native' 3 | import { noop } from 'lodash' 4 | import * as colors from '../../config/colors' 5 | import Icon from 'react-native-vector-icons/Ionicons' 6 | import TouchableView from '../../components/TouchableView' 7 | 8 | const { Header } = NavigationExperimental 9 | 10 | export default class NavigationHeader extends Component { 11 | static propTypes = { 12 | title: PropTypes.string, 13 | onLeftPress: PropTypes.func, 14 | onRightPress: PropTypes.func, 15 | leftIcon: React.PropTypes.string, 16 | rightImage: React.PropTypes.string 17 | } 18 | 19 | static defaultProps = { 20 | title: 'Hello world', 21 | onLeftPress: noop, 22 | onRightPress: noop, 23 | leftIcon: 'ios-arrow-back' 24 | } 25 | 26 | _renderTitleComponent = () => { 27 | const { title } = this.props 28 | return ( 29 | 30 | {title} 31 | 32 | ) 33 | } 34 | 35 | _renderLeftComponent = () => { 36 | const { onLeftPress, leftIcon } = this.props 37 | return ( 38 | 39 | 40 | 41 | ) 42 | } 43 | 44 | _renderRightComponent = () => { 45 | const { onRightPress, rightImage } = this.props 46 | return ( 47 | 48 | 49 | 50 | ) 51 | } 52 | 53 | 54 | render () { 55 | const { rightImage } = this.props 56 | return ( 57 |
null} 63 | /> 64 | ) 65 | } 66 | } 67 | 68 | const styles = StyleSheet.create({ 69 | container: { 70 | flex: 1, 71 | backgroundColor: colors.PRIMARY 72 | }, 73 | titleText: { 74 | color: 'white' 75 | }, 76 | leftButton: { 77 | padding: 14 78 | }, 79 | rightImage: { 80 | width: 22, 81 | height: 22 82 | } 83 | }) 84 | -------------------------------------------------------------------------------- /src/containers/NavigationRouter/NavigationRouter.js: -------------------------------------------------------------------------------- 1 | import React, { Component, PropTypes } from 'react' 2 | import { BackAndroid, NavigationExperimental, StyleSheet } from 'react-native' 3 | import { connect } from 'react-redux' 4 | import { bindActionCreators } from 'redux' 5 | import i18n from '../../i18n' 6 | import { actionCreators as navigationActionCreators, getCurrentRoute } from '../../reducers/navigationReducer' 7 | import { actionCreators as authActionCreators } from '../../reducers/authReducer' 8 | import NavBar from './NavBar' 9 | import SplashScreen from '../SplashScreen/SplashScreen' 10 | import AuthScreen from '../AuthScreen/AuthScreen' 11 | import MainScreen from '../MainScreen/MainScreen' 12 | 13 | const { CardStack } = NavigationExperimental 14 | 15 | const mapStateToProps = (state, ownProps) => ({ 16 | navigationState: state.navigation, 17 | currentRoute: getCurrentRoute(state) 18 | }) 19 | 20 | const mapDispatchToProps = (dispatch) => ({ 21 | ...bindActionCreators({ ...navigationActionCreators, ...authActionCreators }, dispatch), 22 | dispatch 23 | }) 24 | 25 | export class NavigationRouter extends Component { 26 | static propTypes = { 27 | navigationState: PropTypes.object, 28 | currentRoute: PropTypes.object, 29 | autoLogin: PropTypes.func.isRequired, 30 | pop: PropTypes.func.isRequired, 31 | push: PropTypes.func.isRequired, 32 | reset: PropTypes.func.isRequired, 33 | dispatch: PropTypes.func.isRequired 34 | } 35 | 36 | static defaultProps = { 37 | navigationState: {}, 38 | currentRoute: {} 39 | } 40 | 41 | componentDidMount () { 42 | const { pop, autoLogin } = this.props 43 | BackAndroid.addEventListener('hardwareBackPress', pop) 44 | autoLogin() 45 | } 46 | 47 | _renderScene = (props) => { 48 | const { currentRoute } = this.props 49 | switch (currentRoute.key) { 50 | case 'splashScreen': return 51 | case 'authScreen': return 52 | case 'mainScreen': return 53 | default: return null 54 | } 55 | } 56 | 57 | _renderToolbar = (navigatorProps) => { 58 | const { currentRoute } = this.props 59 | if (currentRoute.hideNavBar) return null 60 | const onLeftPress = this.props.pop 61 | return ( 62 | 67 | ) 68 | } 69 | 70 | render () { 71 | const { navigationState, currentRoute, dispatch } = this.props 72 | console.log(`Navigation currentRoute: ${currentRoute.key}`) 73 | return ( 74 | 81 | ) 82 | } 83 | } 84 | 85 | export default connect(mapStateToProps, mapDispatchToProps)(NavigationRouter) 86 | 87 | const styles = StyleSheet.create({ 88 | container: { 89 | flex: 1, 90 | // paddingTop: Metrics.NAVBAR_HEIGHT 91 | } 92 | }) 93 | -------------------------------------------------------------------------------- /src/containers/SplashScreen/SplashScreen.js: -------------------------------------------------------------------------------- 1 | import React, { Component, PropTypes } from 'react' 2 | import { StyleSheet } from 'react-native' 3 | import { View } from 'react-native-animatable' 4 | import { connect } from 'react-redux' 5 | import { bindActionCreators } from 'redux' 6 | import { actionCreators as authActionCreators } from '../../reducers/authReducer' 7 | import * as parseService from '../../services/parseService' 8 | import { PARSE_APP_ID, PARSE_SERVER_URL } from '../../config/keys' 9 | 10 | const mapStateToProps = (state, ownProps) => ({ 11 | user: state.auth.user 12 | }) 13 | 14 | const mapDispatchToProps = (dispatch) => ({ 15 | ...bindActionCreators(authActionCreators, dispatch) 16 | }) 17 | 18 | export class SplashScreen extends Component { 19 | static propTypes = { 20 | autoLogin: PropTypes.func.isRequired 21 | } 22 | 23 | componentDidMount () { 24 | const { autoLogin } = this.props 25 | parseService.initialize(PARSE_APP_ID, PARSE_SERVER_URL) 26 | autoLogin() 27 | } 28 | 29 | render () { 30 | return ( 31 | 32 | ) 33 | } 34 | } 35 | 36 | const styles = StyleSheet.create({ 37 | container: { 38 | flex: 1, 39 | justifyContent: 'space-between' 40 | } 41 | }) 42 | 43 | export default connect(mapStateToProps, mapDispatchToProps)(SplashScreen) 44 | -------------------------------------------------------------------------------- /src/i18n/en.js: -------------------------------------------------------------------------------- 1 | export default { 2 | APP_NAME: 'ReactNativeBoilerplate', 3 | 4 | // Titles 5 | SCREEN_TITLE_MAIN_SCREEN: 'Main', 6 | 7 | // Authentication screen 8 | AUTH_LOGIN_BUTTON: 'Login', 9 | AUTH_SIGNUP_BUTTON: 'Sign Up', 10 | AUTH_FORGOT_BUTTON: 'Forgot?', 11 | AUTH_RESET_BUTTON: 'Send reset link by mail', 12 | AUTH_ALREADY_REGISTERED: 'Already registered?', 13 | AUTH_NO_ACCOUNT: 'Don\'t have an account yet?', 14 | AUTH_INVALID_EMAIL: 'Invalid email address', 15 | AUTH_INVALID_PASSWORD: 'At least 8 characters are required', 16 | AUTH_RESET_PASSWORD_SUCCESS_ALERT_TITLE: 'Email sent', 17 | AUTH_RESET_PASSWORD_SUCCESS_ALERT_CONTENT: 'An email for the password reset has been sent to your address.', 18 | 19 | // Errors 20 | ERROR_TITLE: 'Error' 21 | } 22 | -------------------------------------------------------------------------------- /src/i18n/index.js: -------------------------------------------------------------------------------- 1 | import ReactNativeI18N from 'react-native-i18n' 2 | ReactNativeI18N.fallbacks = true 3 | 4 | import it from './it' 5 | import en from './en' 6 | 7 | ReactNativeI18N.translations = { 8 | en, 9 | it 10 | } 11 | 12 | export default ReactNativeI18N 13 | -------------------------------------------------------------------------------- /src/i18n/it.js: -------------------------------------------------------------------------------- 1 | export default { 2 | APP_NAME: 'ReactNativeBoilerplate', 3 | 4 | // Titles 5 | SCREEN_TITLE_MAIN_SCREEN: 'Main', 6 | 7 | // Authentication screen 8 | AUTH_LOGIN_BUTTON: 'Accedi', 9 | AUTH_SIGNUP_BUTTON: 'Registrati', 10 | AUTH_FORGOT_BUTTON: 'Scordata?', 11 | AUTH_RESET_BUTTON: 'Invia mail di recupero', 12 | AUTH_ALREADY_REGISTERED: 'Già registrato?', 13 | AUTH_NO_ACCOUNT: 'Non sei registrato?', 14 | AUTH_INVALID_EMAIL: 'Indirizzo email non valido', 15 | AUTH_INVALID_PASSWORD: 'Sono richiesti almeno 8 caratteri', 16 | AUTH_RESET_PASSWORD_SUCCESS_ALERT_TITLE: 'Email inviata', 17 | AUTH_RESET_PASSWORD_SUCCESS_ALERT_CONTENT: 'Una mail per il recupero password è stata inviata all\'indirizzo inserito.', 18 | 19 | // Errors 20 | ERROR_TITLE: 'Errore' 21 | } 22 | -------------------------------------------------------------------------------- /src/images/header.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mmazzarolo/react-native-starter/5251e7e35e5a49a90879ce01f9ed1d50e8d1fa6f/src/images/header.png -------------------------------------------------------------------------------- /src/reducers/authReducer.js: -------------------------------------------------------------------------------- 1 | export const actionTypes = { 2 | AUTO_LOGIN: 'AUTH/AUTH_AUTO_LOGIN', 3 | SIGNUP_REQUEST: 'AUTH/SIGNUP_REQUEST', 4 | SIGNUP_SUCCESS: 'AUTH/SIGNUP_SUCCESS', 5 | SIGNUP_FAILURE: 'AUTH/SIGNUP_FAILURE', 6 | LOGIN_REQUEST: 'AUTH/LOGIN_REQUEST', 7 | LOGIN_SUCCESS: 'AUTH/LOGIN_SUCCESS', 8 | LOGIN_FAILURE: 'AUTH/LOGIN_FAILURE', 9 | PASSWORD_RESET_REQUEST: 'AUTH/PASSWORD_RESET_REQUEST', 10 | PASSWORD_RESET_SUCCESS: 'AUTH/PASSWORD_RESET_SUCCESS', 11 | PASSWORD_RESET_FAILURE: 'AUTH/PASSWORD_RESET_FAILURE', 12 | LOGOUT: 'AUTH/LOGOUT' 13 | } 14 | 15 | export const initialState = { 16 | user: null, 17 | isLoading: false, 18 | error: null 19 | } 20 | 21 | export default function reducer (state = initialState, action) { 22 | switch (action.type) { 23 | case actionTypes.SIGNUP_REQUEST: 24 | case actionTypes.LOGIN_REQUEST: 25 | case actionTypes.PASSWORD_RESET_REQUEST: 26 | return { ...state, isLoading: true } 27 | case actionTypes.SIGNUP_SUCCESS: 28 | case actionTypes.LOGIN_SUCCESS: 29 | return { ...state, isLoading: false, user: action.user } 30 | case actionTypes.PASSWORD_RESET_SUCCESS: 31 | return { ...state, isLoading: false } 32 | case actionTypes.SIGNUP_FAILURE: 33 | case actionTypes.LOGIN_FAILURE: 34 | case actionTypes.PASSWORD_RESET_FAILURE: 35 | return { ...state, isLoading: false, error: action.error } 36 | case actionTypes.LOGOUT: 37 | return { ...state, user: null } 38 | default: 39 | return state 40 | } 41 | } 42 | 43 | export const actionCreators = { 44 | autoLogin: () => ({ type: actionTypes.AUTO_LOGIN }), 45 | signup: (email, password) => ({ type: actionTypes.SIGNUP_REQUEST, email, password }), 46 | login: (email, password) => ({ type: actionTypes.LOGIN_REQUEST, email, password }), 47 | resetPassword: (email) => ({ type: actionTypes.PASSWORD_RESET_REQUEST, email }), 48 | logout: () => ({ type: actionTypes.LOGOUT }) 49 | } 50 | -------------------------------------------------------------------------------- /src/reducers/authReducer.spec.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable no-unused-expressions */ 2 | import test from 'ava' 3 | import reducer, { actionTypes } from './authReducer' 4 | 5 | test('handles SIGNUP_REQUEST', (t) => { 6 | const action = { type: actionTypes.SIGNUP_REQUEST } 7 | const state = reducer(undefined, action) 8 | t.true(state.isLoading) 9 | }) 10 | 11 | test('handles SIGNUP_SUCCESS', (t) => { 12 | const user = { username: 'test' } 13 | const action = { type: actionTypes.SIGNUP_SUCCESS, user } 14 | const state = reducer(undefined, action) 15 | t.false(state.isLoading) 16 | t.deepEqual(state.user, user) 17 | }) 18 | 19 | test('handles SIGNUP_FAILURE', (t) => { 20 | const error = 'Generic error' 21 | const action = { type: actionTypes.SIGNUP_FAILURE, error } 22 | const state = reducer(undefined, action) 23 | t.false(state.isLoading) 24 | t.deepEqual(state.error, error) 25 | }) 26 | 27 | test('handles LOGIN_REQUEST', (t) => { 28 | const action = { type: actionTypes.LOGIN_REQUEST } 29 | const state = reducer(undefined, action) 30 | t.true(state.isLoading) 31 | }) 32 | 33 | test('handles LOGIN_SUCCESS', (t) => { 34 | const user = { username: 'test' } 35 | const action = { type: actionTypes.LOGIN_SUCCESS, user } 36 | const state = reducer(undefined, action) 37 | t.false(state.isLoading) 38 | t.deepEqual(state.user, user) 39 | }) 40 | 41 | test('handles LOGIN_FAILURE', (t) => { 42 | const error = 'Generic error' 43 | const action = { type: actionTypes.LOGIN_FAILURE, error } 44 | const state = reducer(undefined, action) 45 | t.false(state.isLoading) 46 | t.deepEqual(state.error, error) 47 | }) 48 | 49 | test('handles PASSWORD_RESET_REQUEST', (t) => { 50 | const action = { type: actionTypes.PASSWORD_RESET_REQUEST } 51 | const state = reducer(undefined, action) 52 | t.true(state.isLoading) 53 | }) 54 | 55 | test('handles PASSWORD_RESET_SUCCESS', (t) => { 56 | const user = { username: 'test' } 57 | const action = { type: actionTypes.PASSWORD_RESET_SUCCESS, user } 58 | const state = reducer(undefined, action) 59 | t.false(state.isLoading) 60 | }) 61 | 62 | test('handles PASSWORD_RESET_FAILURE', (t) => { 63 | const error = 'Generic error' 64 | const action = { type: actionTypes.PASSWORD_RESET_FAILURE, error } 65 | const state = reducer(undefined, action) 66 | t.false(state.isLoading) 67 | t.deepEqual(state.error, error) 68 | }) 69 | 70 | test('handles LOGOUT', (t) => { 71 | const action = { type: actionTypes.LOGOUT } 72 | const state = reducer(undefined, action) 73 | t.is(state.user, null) 74 | }) 75 | -------------------------------------------------------------------------------- /src/reducers/index.js: -------------------------------------------------------------------------------- 1 | import { combineReducers } from 'redux' 2 | import auth from './authReducer' 3 | import navigation from './navigationReducer' 4 | 5 | export default combineReducers({ 6 | auth, 7 | navigation 8 | }) 9 | -------------------------------------------------------------------------------- /src/reducers/navigationReducer.js: -------------------------------------------------------------------------------- 1 | import * as routes from './../config/routes' 2 | import navigationStateUtils from 'NavigationStateUtils' 3 | 4 | export const actionTypes = { 5 | PUSH: 'NAVIGATION/PUSH', 6 | POP: 'NAVIGATION/POP', 7 | RESET: 'NAVIGATION/RESET' 8 | } 9 | 10 | export const initialState = { 11 | key: 'root', 12 | index: 0, 13 | routes: [routes.splashScreen] 14 | } 15 | 16 | export default function reducer (state = initialState, action) { 17 | switch (action.type) { 18 | case actionTypes.PUSH: { 19 | const { route } = action 20 | if (state.routes[state.index].key === (route && route.key)) return state 21 | return navigationStateUtils.push(state, route) 22 | } 23 | case actionTypes.POP: { 24 | if (state.index === 0 || state.routes.length === 1) return state 25 | return navigationStateUtils.pop(state) 26 | } 27 | case actionTypes.RESET: { 28 | const { route } = action 29 | return navigationStateUtils.reset(state, [route], 0) 30 | } 31 | default: 32 | return state 33 | } 34 | } 35 | 36 | export const actionCreators = { 37 | push: (route) => ({ type: actionTypes.PUSH, route }), 38 | pop: () => ({ type: actionTypes.POP }), 39 | reset: (route, index) => ({ type: actionTypes.PUSH, route, index }), 40 | goToSplashScreen: () => ({ type: actionTypes.RESET, route: routes.splashScreen }), 41 | goToAuthScreen: () => ({ type: actionTypes.RESET, route: routes.authenticationScreen }), 42 | goToMainScreen: () => ({ type: actionTypes.PUSH, route: routes.mainScreenScreen }) 43 | } 44 | 45 | export const getCurrentRoute = ({ navigation }) => navigation.routes[navigation.index] 46 | -------------------------------------------------------------------------------- /src/sagas/authSagas.js: -------------------------------------------------------------------------------- 1 | import { call, put } from 'redux-saga/effects' 2 | import * as parseService from '../services/parseService' 3 | import * as alertHandler from '../services/alertHandler' 4 | import { actionTypes as authActionTypes } from '../reducers/authReducer' 5 | import { actionTypes as navigationActionTypes } from '../reducers/navigationReducer' 6 | import * as routes from '../config/routes' 7 | 8 | export function* autoLogin (action) { 9 | const user = yield call(parseService.currentUser) 10 | if (user) { 11 | yield put({ type: authActionTypes.LOGIN_SUCCESS, user }) 12 | yield put({ type: navigationActionTypes.RESET, route: routes.mainScreen }) 13 | } else { 14 | yield put({ type: navigationActionTypes.RESET, route: routes.authScreen }) 15 | } 16 | } 17 | 18 | export function* signup (action) { 19 | const { email, password } = action 20 | try { 21 | const user = yield call(parseService.signup, email, password) 22 | yield put({ type: authActionTypes.SIGNUP_SUCCESS, user }) 23 | yield put({ type: authActionTypes.LOGIN_SUCCESS, user }) 24 | yield put({ type: navigationActionTypes.RESET, route: routes.mainScreen }) 25 | } catch (err) { 26 | const error = err.message || err 27 | yield put({ type: authActionTypes.SIGNUP_FAILURE, error }) 28 | yield call(alertHandler.showErrorAlert, error) 29 | } 30 | } 31 | 32 | export function* login (action) { 33 | const { email, password } = action 34 | try { 35 | const user = yield call(parseService.login, email, password) 36 | yield put({ type: authActionTypes.LOGIN_SUCCESS, user }) 37 | yield put({ type: navigationActionTypes.RESET, route: routes.mainScreen }) 38 | } catch (err) { 39 | const error = err.message || err 40 | yield put({ type: authActionTypes.LOGIN_FAILURE, error }) 41 | yield call(alertHandler.showErrorAlert, error) 42 | } 43 | } 44 | 45 | export function* resetPassword (action) { 46 | const { email } = action 47 | try { 48 | yield call(parseService.resetPassword, email) 49 | yield put({ type: authActionTypes.PASSWORD_RESET_SUCCESS }) 50 | yield call(alertHandler.showResetPasswordSuccessAlert) 51 | } catch (err) { 52 | const error = err.message || err 53 | yield put({ type: authActionTypes.PASSWORD_RESET_FAILURE, error }) 54 | yield call(alertHandler.showErrorAlert, error) 55 | } 56 | } 57 | 58 | export function* logout (action) { 59 | yield call(parseService.logout) 60 | yield put({ type: navigationActionTypes.RESET, route: routes.authScreen }) 61 | } 62 | -------------------------------------------------------------------------------- /src/sagas/authSagas.spec.js: -------------------------------------------------------------------------------- 1 | import test from 'ava' 2 | import { call, put } from 'redux-saga/effects' 3 | import { actionTypes as authActionTypes } from '../reducers/authReducer' 4 | import { actionTypes as navigationActionTypes } from '../reducers/navigationReducer' 5 | import { autoLogin, signup, login, logout, resetPassword } from './authSagas' 6 | import * as parseService from '../services/parseService' 7 | import * as alertHandler from '../services/alertHandler' 8 | import * as routes from '../config/routes' 9 | 10 | test('autoLogin saga ends successfully', (t) => { 11 | const generator = autoLogin() 12 | 13 | let next = generator.next() 14 | t.deepEqual(next.value, call(parseService.currentUser)) 15 | 16 | const user = { username: 'test' } 17 | next = generator.next(user) 18 | t.deepEqual(next.value, put({ type: authActionTypes.LOGIN_SUCCESS, user })) 19 | 20 | next = generator.next() 21 | t.deepEqual(next.value, put({ type: navigationActionTypes.RESET, route: routes.mainScreen })) 22 | }) 23 | 24 | test('autoLogin saga ends in error', (t) => { 25 | const generator = autoLogin() 26 | 27 | let next = generator.next() 28 | t.deepEqual(next.value, call(parseService.currentUser)) 29 | 30 | next = generator.next(null) 31 | t.deepEqual(next.value, put({ type: navigationActionTypes.RESET, route: routes.authScreen })) 32 | }) 33 | 34 | test('signup saga ends successfully', (t) => { 35 | const email = 'testEmail' 36 | const password = 'testPassword' 37 | const action = { email, password } 38 | const generator = signup(action) 39 | 40 | let next = generator.next() 41 | t.deepEqual(next.value, call(parseService.signup, email, password)) 42 | 43 | const user = { username: 'test' } 44 | next = generator.next(user) 45 | t.deepEqual(next.value, put({ type: authActionTypes.SIGNUP_SUCCESS, user })) 46 | 47 | next = generator.next() 48 | t.deepEqual(next.value, put({ type: authActionTypes.LOGIN_SUCCESS, user })) 49 | 50 | next = generator.next() 51 | t.deepEqual(next.value, put({ type: navigationActionTypes.RESET, route: routes.mainScreen })) 52 | }) 53 | 54 | test('signup saga ends in error', (t) => { 55 | const email = 'testEmail' 56 | const password = 'testPassword' 57 | const action = { email, password } 58 | const generator = signup(action) 59 | 60 | let next = generator.next() 61 | t.deepEqual(next.value, call(parseService.signup, email, password)) 62 | 63 | const error = 'Generic error' 64 | next = generator.throw(error) 65 | t.deepEqual(next.value, put({ type: authActionTypes.SIGNUP_FAILURE, error })) 66 | 67 | next = generator.next() 68 | t.deepEqual(next.value, call(alertHandler.showErrorAlert, error)) 69 | }) 70 | 71 | test('login saga ends successfully', (t) => { 72 | const email = 'testEmail' 73 | const password = 'testPassword' 74 | const action = { email, password } 75 | const generator = login(action) 76 | 77 | let next = generator.next() 78 | t.deepEqual(next.value, call(parseService.login, email, password)) 79 | 80 | const user = { username: 'test' } 81 | 82 | next = generator.next(user) 83 | t.deepEqual(next.value, put({ type: authActionTypes.LOGIN_SUCCESS, user })) 84 | 85 | next = generator.next() 86 | t.deepEqual(next.value, put({ type: navigationActionTypes.RESET, route: routes.mainScreen })) 87 | }) 88 | 89 | test('login saga ends in error', (t) => { 90 | const email = 'testEmail' 91 | const password = 'testPassword' 92 | const action = { email, password } 93 | const generator = login(action) 94 | 95 | let next = generator.next() 96 | t.deepEqual(next.value, call(parseService.login, email, password)) 97 | 98 | const error = 'Generic error' 99 | next = generator.throw(error) 100 | t.deepEqual(next.value, put({ type: authActionTypes.LOGIN_FAILURE, error })) 101 | 102 | next = generator.next() 103 | t.deepEqual(next.value, call(alertHandler.showErrorAlert, error)) 104 | }) 105 | 106 | test('logout saga ends successfully', (t) => { 107 | const generator = logout() 108 | 109 | let next = generator.next() 110 | t.deepEqual(next.value, call(parseService.logout)) 111 | 112 | next = generator.next() 113 | t.deepEqual(next.value, put({ type: navigationActionTypes.RESET, route: routes.authScreen })) 114 | }) 115 | 116 | test('resetPassword saga ends successfully', (t) => { 117 | const email = 'testEmail' 118 | const action = { email } 119 | const generator = resetPassword(action) 120 | 121 | let next = generator.next() 122 | t.deepEqual(next.value, call(parseService.resetPassword, email)) 123 | 124 | next = generator.next() 125 | t.deepEqual(next.value, put({ type: authActionTypes.PASSWORD_RESET_SUCCESS })) 126 | 127 | next = generator.next() 128 | t.deepEqual(next.value, call(alertHandler.showResetPasswordSuccessAlert)) 129 | }) 130 | 131 | test('resetPassword saga ends in error', (t) => { 132 | const email = 'testEmail' 133 | const action = { email } 134 | const generator = resetPassword(action) 135 | 136 | let next = generator.next() 137 | t.deepEqual(next.value, call(parseService.resetPassword, email)) 138 | 139 | const error = 'Generic error' 140 | next = generator.throw(error) 141 | t.deepEqual(next.value, put({ type: authActionTypes.PASSWORD_RESET_FAILURE, error })) 142 | 143 | next = generator.next() 144 | t.deepEqual(next.value, call(alertHandler.showErrorAlert, error)) 145 | }) 146 | -------------------------------------------------------------------------------- /src/sagas/index.js: -------------------------------------------------------------------------------- 1 | import { takeEvery } from 'redux-saga' 2 | import { actionTypes as authActionTypes } from '../reducers/authReducer' 3 | 4 | import { autoLogin, login, logout, signup, resetPassword } from './authSagas' 5 | 6 | export default function* rootSaga () { 7 | yield [ 8 | takeEvery(authActionTypes.AUTO_LOGIN, autoLogin), 9 | takeEvery(authActionTypes.SIGNUP_REQUEST, signup), 10 | takeEvery(authActionTypes.LOGIN_REQUEST, login), 11 | takeEvery(authActionTypes.PASSWORD_RESET_REQUEST, resetPassword), 12 | takeEvery(authActionTypes.LOGOUT, logout) 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /src/services/alertHandler.js: -------------------------------------------------------------------------------- 1 | import { Alert } from 'react-native' 2 | import i18n from '../i18n/' 3 | 4 | export const showErrorAlert = (error) => { 5 | Alert.alert(i18n.t('ERROR_TITLE'), error) 6 | } 7 | 8 | export const showResetPasswordSuccessAlert = () => { 9 | Alert.alert( 10 | i18n.t('AUTH_RESET_PASSWORD_SUCCESS_ALERT_TITLE'), 11 | i18n.t('AUTH_RESET_PASSWORD_SUCCESS_ALERT_CONTENT') 12 | ) 13 | } 14 | -------------------------------------------------------------------------------- /src/services/formValidation.js: -------------------------------------------------------------------------------- 1 | export const validateEmail = (email) => { 2 | const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/ 3 | return emailRegex.test(email) 4 | } 5 | 6 | export const validatePassword = (password) => { 7 | return password.length >= 8 8 | } 9 | -------------------------------------------------------------------------------- /src/services/parseService.js: -------------------------------------------------------------------------------- 1 | import Parse from 'parse/react-native' 2 | 3 | export const initialize = (appId, serverURL) => { 4 | Parse.initialize(appId) 5 | Parse.serverURL = serverURL 6 | } 7 | 8 | export const currentUser = async () => { 9 | const user = await Parse.User.currentAsync() 10 | return user ? user.toJSON() : null 11 | } 12 | 13 | export const signup = async (email, password) => { 14 | const user = new Parse.User() 15 | user.set('username', email) 16 | user.set('email', email) 17 | user.set('password', password) 18 | const loggedUser = await user.signUp() 19 | return loggedUser.toJSON() 20 | } 21 | 22 | export const login = async (email, password) => { 23 | const user = await Parse.User.logIn(email, password) 24 | return user.toJSON() 25 | } 26 | export const resetPassword = async (email) => { 27 | await Parse.User.requestPasswordReset(email) 28 | return true 29 | } 30 | 31 | export const logout = async () => { 32 | Parse.User.logOut() 33 | return true 34 | } 35 | -------------------------------------------------------------------------------- /src/store/configureStore.js: -------------------------------------------------------------------------------- 1 | import { createStore, applyMiddleware, compose } from 'redux' 2 | import createLogger from 'redux-logger' 3 | import reducers from '../reducers/' 4 | import createSagaMiddleware from 'redux-saga' 5 | import sagas from '../sagas/' 6 | 7 | export default (initialState = {}, browserHistory) => { 8 | const middlewares = [] 9 | 10 | // Create the saga middleware 11 | const sagaMiddleware = createSagaMiddleware() 12 | middlewares.push(sagaMiddleware) 13 | 14 | // Create the logger 15 | if (__DEV__) { 16 | const LOGGING_BLACKLIST = ['EFFECT_TRIGGERED', 'EFFECT_RESOLVED', 'EFFECT_REJECTED'] 17 | const logger = createLogger({ 18 | collapsed: true, 19 | predicate: (getState, action) => !LOGGING_BLACKLIST.includes(action.type) 20 | }) 21 | middlewares.push(logger) 22 | } 23 | 24 | // Create and export the store 25 | const createStoreWithMiddleware = applyMiddleware(...middlewares) 26 | const finalCreateStore = createStoreWithMiddleware(createStore) 27 | const store = finalCreateStore(reducers, initialState) 28 | 29 | // Start the sagas 30 | sagaMiddleware.run(sagas) 31 | 32 | return store 33 | } 34 | -------------------------------------------------------------------------------- /test/mocks/i18n.js: -------------------------------------------------------------------------------- 1 | import { spy } from 'sinon' 2 | 3 | export default { 4 | fallback: null, 5 | translations: null, 6 | locale: null, 7 | t: () => spy 8 | } 9 | -------------------------------------------------------------------------------- /test/mocks/parse.js: -------------------------------------------------------------------------------- 1 | import { spy } from 'sinon' 2 | 3 | const ParseUser = { 4 | toJSON: spy(), 5 | set: spy(), 6 | get: spy() 7 | } 8 | 9 | export default { 10 | initialize: spy(), 11 | signUp: () => ParseUser, 12 | logIn: () => ParseUser, 13 | logOut: spy(), 14 | User: { Current: ParseUser } 15 | } 16 | -------------------------------------------------------------------------------- /test/setup.js: -------------------------------------------------------------------------------- 1 | import mockery from 'mockery' 2 | import parseMock from './mocks/parse' 3 | import i18nMock from './mocks/i18n' 4 | 5 | global.__DEV__ = true 6 | 7 | mockery.enable() 8 | mockery.warnOnUnregistered(false) 9 | 10 | mockery.registerMock('parse/react-native', parseMock) 11 | mockery.registerMock('react-native-i18n', i18nMock) 12 | mockery.registerMock('NavigationStateUtils', {}) 13 | --------------------------------------------------------------------------------