From b098f503633ead8cb13de1962baebfa93ac5dd57 Mon Sep 17 00:00:00 2001 From: Kenny Tian Date: Sun, 28 Aug 2016 17:29:21 +0800 Subject: [PATCH] refactor lagou app --- .buckconfig | 6 + .flowconfig | 65 +++++----- .gitignore | 13 +- .watchmanconfig | 4 +- README.md | 19 ++- android/app/BUCK | 66 +++++++++++ android/app/build.gradle | 19 ++- android/app/proguard-rules.pro | 13 +- android/app/react.gradle | 97 --------------- android/app/src/main/AndroidManifest.xml | 10 +- .../main/java/com/lagouapp/MainActivity.java | 25 ---- .../java/com/lagouapp/MainApplication.java | 35 ++++++ android/app/src/main/res/values/strings.xml | 2 +- android/build.gradle | 2 +- android/keystores/BUCK | 8 ++ android/keystores/debug.keystore.properties | 4 + app-registry.js | 5 +- framepage.js | 4 +- index.android.js | 6 +- index.ios.js | 6 +- .../project.pbxproj | 112 +++++++++--------- .../xcshareddata/xcschemes/LagouApp.xcscheme} | 36 +++--- ios/{MyProject => LagouApp}/AppDelegate.h | 0 ios/{MyProject => LagouApp}/AppDelegate.m | 26 +--- .../Base.lproj/LaunchScreen.xib | 4 +- .../AppIcon.appiconset/Contents.json | 0 ios/{MyProject => LagouApp}/Info.plist | 22 ++-- ios/{MyProject => LagouApp}/main.m | 0 .../Info.plist | 0 .../LagouAppTests.m} | 6 +- launcher.js | 23 ++++ package.json | 6 +- routehome.js | 4 +- routeme.js | 4 +- splash.js | 50 ++++---- src/frame.js | 54 +++++++++ {images => src/images}/avatar.png | Bin {images => src/images}/avatar_bg.png | Bin {images => src/images}/hello_page_bg.png | Bin {images => src/images}/icon_back.png | Bin {images => src/images}/icon_find_nor.png | Bin {images => src/images}/icon_find_ok.png | Bin {images => src/images}/icon_find_pre.png | Bin .../images}/icon_forget_password.png | Bin {images => src/images}/icon_home_nor.png | Bin {images => src/images}/icon_home_pre.png | Bin {images => src/images}/icon_message_nor.png | Bin {images => src/images}/icon_message_pre.png | Bin {images => src/images}/icon_search.png | Bin {images => src/images}/icon_user_collect.png | Bin {images => src/images}/icon_user_feedback.png | Bin .../images}/icon_user_info_mail.png | Bin .../images}/icon_user_info_name.png | Bin .../images}/icon_user_info_work.png | Bin {images => src/images}/icon_user_nor.png | Bin {images => src/images}/icon_user_pre.png | Bin {images => src/images}/icon_user_resume.png | Bin {images => src/images}/icon_user_setting.png | Bin {images => src/images}/job1.jpg | Bin {images => src/images}/job2.jpg | Bin {images => src/images}/job3.jpg | Bin {images => src/images}/job4.jpg | Bin {images => src/images}/message_num_bg.png | Bin src/page1.js | 34 ++++++ src/page2.js | 42 +++++++ src/page3.js | 42 +++++++ src/splash.js | 51 ++++++++ 67 files changed, 587 insertions(+), 338 deletions(-) create mode 100644 .buckconfig create mode 100644 android/app/BUCK delete mode 100644 android/app/react.gradle create mode 100644 android/app/src/main/java/com/lagouapp/MainApplication.java create mode 100644 android/keystores/BUCK create mode 100644 android/keystores/debug.keystore.properties rename ios/{MyProject.xcodeproj => LagouApp.xcodeproj}/project.pbxproj (90%) rename ios/{MyProject.xcodeproj/xcshareddata/xcschemes/MyProject.xcscheme => LagouApp.xcodeproj/xcshareddata/xcschemes/LagouApp.xcscheme} (77%) rename ios/{MyProject => LagouApp}/AppDelegate.h (100%) rename ios/{MyProject => LagouApp}/AppDelegate.m (57%) rename ios/{MyProject => LagouApp}/Base.lproj/LaunchScreen.xib (87%) rename ios/{MyProject => LagouApp}/Images.xcassets/AppIcon.appiconset/Contents.json (100%) rename ios/{MyProject => LagouApp}/Info.plist (76%) rename ios/{MyProject => LagouApp}/main.m (100%) rename ios/{MyProjectTests => LagouAppTests}/Info.plist (100%) rename ios/{MyProjectTests/MyProjectTests.m => LagouAppTests/LagouAppTests.m} (95%) create mode 100644 launcher.js create mode 100644 src/frame.js rename {images => src/images}/avatar.png (100%) rename {images => src/images}/avatar_bg.png (100%) rename {images => src/images}/hello_page_bg.png (100%) rename {images => src/images}/icon_back.png (100%) rename {images => src/images}/icon_find_nor.png (100%) rename {images => src/images}/icon_find_ok.png (100%) rename {images => src/images}/icon_find_pre.png (100%) rename {images => src/images}/icon_forget_password.png (100%) rename {images => src/images}/icon_home_nor.png (100%) rename {images => src/images}/icon_home_pre.png (100%) rename {images => src/images}/icon_message_nor.png (100%) rename {images => src/images}/icon_message_pre.png (100%) rename {images => src/images}/icon_search.png (100%) rename {images => src/images}/icon_user_collect.png (100%) rename {images => src/images}/icon_user_feedback.png (100%) rename {images => src/images}/icon_user_info_mail.png (100%) rename {images => src/images}/icon_user_info_name.png (100%) rename {images => src/images}/icon_user_info_work.png (100%) rename {images => src/images}/icon_user_nor.png (100%) rename {images => src/images}/icon_user_pre.png (100%) rename {images => src/images}/icon_user_resume.png (100%) rename {images => src/images}/icon_user_setting.png (100%) rename {images => src/images}/job1.jpg (100%) rename {images => src/images}/job2.jpg (100%) rename {images => src/images}/job3.jpg (100%) rename {images => src/images}/job4.jpg (100%) rename {images => src/images}/message_num_bg.png (100%) create mode 100644 src/page1.js create mode 100644 src/page2.js create mode 100644 src/page3.js create mode 100644 src/splash.js diff --git a/.buckconfig b/.buckconfig new file mode 100644 index 0000000..934256c --- /dev/null +++ b/.buckconfig @@ -0,0 +1,6 @@ + +[android] + target = Google Inc.:Google APIs:23 + +[maven_repositories] + central = https://repo1.maven.org/maven2 diff --git a/.flowconfig b/.flowconfig index c3edaf9..4bea710 100644 --- a/.flowconfig +++ b/.flowconfig @@ -1,65 +1,58 @@ [ignore] # We fork some components by platform. -.*/*.web.js -.*/*.android.js +.*/*[.]android.js -# Some modules have their own node_modules with overlap -.*/node_modules/node-haste/.* +# Ignore templates with `@flow` in header +.*/local-cli/generator.* -# Ugh -.*/node_modules/babel.* -.*/node_modules/babylon.* -.*/node_modules/invariant.* +# Ignore malformed json +.*/node_modules/y18n/test/.*\.json -# Ignore react and fbjs where there are overlaps, but don't ignore -# anything that react-native relies on -.*/node_modules/fbjs/lib/Map.js -.*/node_modules/fbjs/lib/Promise.js -.*/node_modules/fbjs/lib/fetch.js -.*/node_modules/fbjs/lib/ExecutionEnvironment.js -.*/node_modules/fbjs/lib/isEmpty.js -.*/node_modules/fbjs/lib/crc32.js -.*/node_modules/fbjs/lib/ErrorUtils.js +# Ignore the website subdir +/website/.* -# Flow has a built-in definition for the 'react' module which we prefer to use -# over the currently-untyped source -.*/node_modules/react/react.js -.*/node_modules/react/lib/React.js -.*/node_modules/react/lib/ReactDOM.js +# Ignore BUCK generated dirs +/\.buckd/ -# Ignore commoner tests -.*/node_modules/commoner/test/.* +# Ignore unexpected extra @providesModule +.*/node_modules/commoner/test/source/widget/share.js -# See https://github.com/facebook/flow/issues/442 -.*/react-tools/node_modules/commoner/lib/reader.js - -# Ignore jest -.*/node_modules/jest-cli/.* - -# Ignore Website -.*/website/.* +# Ignore duplicate module providers +# For RN Apps installed via npm, "Libraries" folder is inside node_modules/react-native but in the source repo it is in the root +.*/Libraries/react-native/React.js +.*/Libraries/react-native/ReactNative.js +.*/node_modules/jest-runtime/build/__tests__/.* [include] [libs] node_modules/react-native/Libraries/react-native/react-native-interface.js +node_modules/react-native/flow +flow/ [options] module.system=haste +esproposal.class_static_fields=enable +esproposal.class_instance_fields=enable + +experimental.strict_type_args=true + munge_underscores=true module.name_mapper='^image![a-zA-Z0-9$_-]+$' -> 'GlobalImageStub' -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\)$' -> 'RelativeImageStub' +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' suppress_type=$FlowIssue suppress_type=$FlowFixMe suppress_type=$FixMe -suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(2[0-1]\\|1[0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\) -suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(2[0-1]\\|1[0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+ +suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(30\\|[1-2][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\) +suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(30\\|1[0-9]\\|[1-2][0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+ suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy +unsafe.enable_getters_and_setters=true + [version] -0.21.0 +^0.30.0 diff --git a/.gitignore b/.gitignore index af595d1..eb1535e 100644 --- a/.gitignore +++ b/.gitignore @@ -21,18 +21,21 @@ DerivedData *.ipa *.xcuserstate project.xcworkspace -ios/build # Android/IJ # +*.iml .idea .gradle local.properties -android/build -android/app/build # node.js # -node_modules +node_modules/ npm-debug.log -images/pic.gif + +# BUCK +buck-out/ +\.buckd/ +android/app/libs +android/keystores/debug.keystore diff --git a/.watchmanconfig b/.watchmanconfig index c472dc0..9e26dfe 100644 --- a/.watchmanconfig +++ b/.watchmanconfig @@ -1,3 +1 @@ -{ - "ignore_dirs": [".idea", ".git", "android/build", "android/app/build", "ios/build"] -} \ No newline at end of file +{} \ No newline at end of file diff --git a/README.md b/README.md index 749328e..4ada856 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # 拉一勾 -#### 开发一个仿拉勾的App, 基于react-native 0.21,代码用ES6实现,同时支持Android和iOS. +#### 开发一个仿拉勾的App, 基于react-native 0.32,代码用ES6实现,同时支持Android和iOS. ### 安装 ``` @@ -17,12 +17,21 @@ react-native run-ios ### 依赖项: ``` "dependencies": { - "react-native": "^0.21.0", - "react-native-tab-navigator": "^0.2.17", - "react-native-viewpager": "^0.2.1" + "react": "15.3.1", + "react-native": "0.32.0", + "react-native-router-flux": "^3.35.0", + "react-native-tab-navigator": "^0.3.3", + "react-native-viewpager": "^0.2.11" } ``` ![APP界面](https://raw.githubusercontent.com/Kennytian/LagouApp/master/screenshot.gif) -参考项目:https://github.com/heruijun/react-native-lagou \ No newline at end of file +参考项目:https://github.com/heruijun/react-native-lagou + +``` +react-native run-ios --simulator "iPhone 4s" +react-native run-ios --simulator "iPhone 5" +react-native run-ios --simulator "iPhone 6 Plus" + +``` \ No newline at end of file diff --git a/android/app/BUCK b/android/app/BUCK new file mode 100644 index 0000000..b5ae6c8 --- /dev/null +++ b/android/app/BUCK @@ -0,0 +1,66 @@ +import re + +# To learn about Buck see [Docs](https://buckbuild.com/). +# To run your application with Buck: +# - install Buck +# - `npm start` - to start the packager +# - `cd android` +# - `keytool -genkey -v -keystore keystores/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname "CN=Android Debug,O=Android,C=US"` +# - `./gradlew :app:copyDownloadableDepsToLibs` - make all Gradle compile dependencies available to Buck +# - `buck install -r android/app` - compile, install and run application +# + +lib_deps = [] +for jarfile in glob(['libs/*.jar']): + name = 'jars__' + re.sub(r'^.*/([^/]+)\.jar$', r'\1', jarfile) + lib_deps.append(':' + name) + prebuilt_jar( + name = name, + binary_jar = jarfile, + ) + +for aarfile in glob(['libs/*.aar']): + name = 'aars__' + re.sub(r'^.*/([^/]+)\.aar$', r'\1', aarfile) + lib_deps.append(':' + name) + android_prebuilt_aar( + name = name, + aar = aarfile, + ) + +android_library( + name = 'all-libs', + exported_deps = lib_deps +) + +android_library( + name = 'app-code', + srcs = glob([ + 'src/main/java/**/*.java', + ]), + deps = [ + ':all-libs', + ':build_config', + ':res', + ], +) + +android_build_config( + name = 'build_config', + package = 'com.lagouapp', +) + +android_resource( + name = 'res', + res = 'src/main/res', + package = 'com.lagouapp', +) + +android_binary( + name = 'app', + package_type = 'debug', + manifest = 'src/main/AndroidManifest.xml', + keystore = '//android/keystores:debug', + deps = [ + ':app-code', + ], +) diff --git a/android/app/build.gradle b/android/app/build.gradle index fa78e56..b43efb4 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -9,7 +9,7 @@ import com.android.build.OutputFile * cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the * bundle directly from the development server. Below you can see all the possible configurations * and their defaults. If you decide to add a configuration block, make sure to add it before the - * `apply from: "react.gradle"` line. + * `apply from: "../../node_modules/react-native/react.gradle"` line. * * project.ext.react = [ * // the name of the generated asset file containing your JS bundle @@ -55,11 +55,17 @@ import com.android.build.OutputFile * // date; if you have any other folders that you want to ignore for performance reasons (gradle * // indexes the entire tree), add them here. Alternatively, if you have JS files in android/ * // for example, you might want to remove it from here. - * inputExcludes: ["android/**", "ios/**"] + * inputExcludes: ["android/**", "ios/**"], + * + * // override which node gets called and with what additional arguments + * nodeExecutableAndArgs: ["node"] + * + * // supply additional arguments to the packager + * extraPackagerArgs: [] * ] */ -apply from: "react.gradle" +apply from: "../../node_modules/react-native/react.gradle" /** * Set this to true to create two separate APKs instead of one: @@ -124,3 +130,10 @@ dependencies { compile "com.android.support:appcompat-v7:23.0.1" compile "com.facebook.react:react-native:+" // From node_modules } + +// Run this once to be able to run the application with BUCK +// puts all compile dependencies into folder libs for BUCK to use +task copyDownloadableDepsToLibs(type: Copy) { + from configurations.compile + into 'libs' +} diff --git a/android/app/proguard-rules.pro b/android/app/proguard-rules.pro index 7d72e46..48361a9 100644 --- a/android/app/proguard-rules.pro +++ b/android/app/proguard-rules.pro @@ -26,11 +26,14 @@ # See http://sourceforge.net/p/proguard/bugs/466/ -keep,allowobfuscation @interface com.facebook.proguard.annotations.DoNotStrip -keep,allowobfuscation @interface com.facebook.proguard.annotations.KeepGettersAndSetters +-keep,allowobfuscation @interface com.facebook.common.internal.DoNotStrip # Do not strip any method/class that is annotated with @DoNotStrip -keep @com.facebook.proguard.annotations.DoNotStrip class * +-keep @com.facebook.common.internal.DoNotStrip class * -keepclassmembers class * { @com.facebook.proguard.annotations.DoNotStrip *; + @com.facebook.common.internal.DoNotStrip *; } -keepclassmembers @com.facebook.proguard.annotations.KeepGettersAndSetters class * { @@ -51,9 +54,9 @@ -keepattributes Signature -keepattributes *Annotation* --keep class com.squareup.okhttp.** { *; } --keep interface com.squareup.okhttp.** { *; } --dontwarn com.squareup.okhttp.** +-keep class okhttp3.** { *; } +-keep interface okhttp3.** { *; } +-dontwarn okhttp3.** # okio @@ -61,7 +64,3 @@ -dontwarn java.nio.file.* -dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement -dontwarn okio.** - -# stetho - --dontwarn com.facebook.stetho.** diff --git a/android/app/react.gradle b/android/app/react.gradle deleted file mode 100644 index 11a4f8b..0000000 --- a/android/app/react.gradle +++ /dev/null @@ -1,97 +0,0 @@ -import org.apache.tools.ant.taskdefs.condition.Os - -def config = project.hasProperty("react") ? project.react : []; - -def bundleAssetName = config.bundleAssetName ?: "index.android.bundle" -def entryFile = config.entryFile ?: "index.android.js" - -// because elvis operator -def elvisFile(thing) { - return thing ? file(thing) : null; -} - -def reactRoot = elvisFile(config.root) ?: file("../../") -def inputExcludes = config.inputExcludes ?: ["android/**", "ios/**"] - -void runBefore(String dependentTaskName, Task task) { - Task dependentTask = tasks.findByPath(dependentTaskName); - if (dependentTask != null) { - dependentTask.dependsOn task - } -} - -gradle.projectsEvaluated { - // Grab all build types and product flavors - def buildTypes = android.buildTypes.collect { type -> type.name } - def productFlavors = android.productFlavors.collect { flavor -> flavor.name } - - // When no product flavors defined, use empty - if (!productFlavors) productFlavors.add('') - - productFlavors.each { productFlavorName -> - buildTypes.each { buildTypeName -> - // Create variant and target names - def targetName = "${productFlavorName.capitalize()}${buildTypeName.capitalize()}" - def targetPath = productFlavorName ? - "${productFlavorName}/${buildTypeName}" : - "${buildTypeName}" - - // React js bundle directories - def jsBundleDirConfigName = "jsBundleDir${targetName}" - def jsBundleDir = elvisFile(config."$jsBundleDirConfigName") ?: - file("$buildDir/intermediates/assets/${targetPath}") - - def resourcesDirConfigName = "jsBundleDir${targetName}" - def resourcesDir = elvisFile(config."${resourcesDirConfigName}") ?: - file("$buildDir/intermediates/res/merged/${targetPath}") - def jsBundleFile = file("$jsBundleDir/$bundleAssetName") - - // Bundle task name for variant - def bundleJsAndAssetsTaskName = "bundle${targetName}JsAndAssets" - - def currentBundleTask = tasks.create( - name: bundleJsAndAssetsTaskName, - type: Exec) { - group = "react" - description = "bundle JS and assets for ${targetName}." - - // Create dirs if they are not there (e.g. the "clean" task just ran) - doFirst { - jsBundleDir.mkdirs() - resourcesDir.mkdirs() - } - - // Set up inputs and outputs so gradle can cache the result - inputs.files fileTree(dir: reactRoot, excludes: inputExcludes) - outputs.dir jsBundleDir - outputs.dir resourcesDir - - // Set up the call to the react-native cli - workingDir reactRoot - - // Set up dev mode - def devEnabled = !targetName.toLowerCase().contains("release") - if (Os.isFamily(Os.FAMILY_WINDOWS)) { - commandLine "cmd", "/c", "react-native", "bundle", "--platform", "android", "--dev", "${devEnabled}", - "--entry-file", entryFile, "--bundle-output", jsBundleFile, "--assets-dest", resourcesDir - } else { - commandLine "react-native", "bundle", "--platform", "android", "--dev", "${devEnabled}", - "--entry-file", entryFile, "--bundle-output", jsBundleFile, "--assets-dest", resourcesDir - } - - enabled config."bundleIn${targetName}" || - config."bundleIn${buildTypeName.capitalize()}" ?: - targetName.toLowerCase().contains("release") - } - - // Hook bundle${productFlavor}${buildType}JsAndAssets into the android build process - currentBundleTask.dependsOn("merge${targetName}Resources") - currentBundleTask.dependsOn("merge${targetName}Assets") - - runBefore("processArmeabi-v7a${targetName}Resources", currentBundleTask) - runBefore("processX86${targetName}Resources", currentBundleTask) - runBefore("processUniversal${targetName}Resources", currentBundleTask) - runBefore("process${targetName}Resources", currentBundleTask) - } - } -} diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index d3e0c67..51ffd2e 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -1,9 +1,17 @@ + package="com.lagouapp" + android:versionCode="1" + android:versionName="1.0"> + + + getPackages() { - return Arrays.asList( - new MainReactPackage() - ); - } } diff --git a/android/app/src/main/java/com/lagouapp/MainApplication.java b/android/app/src/main/java/com/lagouapp/MainApplication.java new file mode 100644 index 0000000..b28db8c --- /dev/null +++ b/android/app/src/main/java/com/lagouapp/MainApplication.java @@ -0,0 +1,35 @@ +package com.lagouapp; + +import android.app.Application; +import android.util.Log; + +import com.facebook.react.ReactApplication; +import com.facebook.react.ReactInstanceManager; +import com.facebook.react.ReactNativeHost; +import com.facebook.react.ReactPackage; +import com.facebook.react.shell.MainReactPackage; + +import java.util.Arrays; +import java.util.List; + +public class MainApplication extends Application implements ReactApplication { + + private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) { + @Override + protected boolean getUseDeveloperSupport() { + return BuildConfig.DEBUG; + } + + @Override + protected List getPackages() { + return Arrays.asList( + new MainReactPackage() + ); + } + }; + + @Override + public ReactNativeHost getReactNativeHost() { + return mReactNativeHost; + } +} diff --git a/android/app/src/main/res/values/strings.xml b/android/app/src/main/res/values/strings.xml index cc4e610..00e02cb 100644 --- a/android/app/src/main/res/values/strings.xml +++ b/android/app/src/main/res/values/strings.xml @@ -1,3 +1,3 @@ - ReactNative拉勾 + LagouApp diff --git a/android/build.gradle b/android/build.gradle index 403a007..fcba4c5 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -18,7 +18,7 @@ allprojects { jcenter() maven { // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm - url "$projectDir/../../node_modules/react-native/android" + url "$rootDir/../node_modules/react-native/android" } } } diff --git a/android/keystores/BUCK b/android/keystores/BUCK new file mode 100644 index 0000000..15da20e --- /dev/null +++ b/android/keystores/BUCK @@ -0,0 +1,8 @@ +keystore( + name = 'debug', + store = 'debug.keystore', + properties = 'debug.keystore.properties', + visibility = [ + 'PUBLIC', + ], +) diff --git a/android/keystores/debug.keystore.properties b/android/keystores/debug.keystore.properties new file mode 100644 index 0000000..121bfb4 --- /dev/null +++ b/android/keystores/debug.keystore.properties @@ -0,0 +1,4 @@ +key.store=debug.keystore +key.alias=androiddebugkey +key.store.password=android +key.alias.password=android diff --git a/app-registry.js b/app-registry.js index 3108d60..fb0df45 100644 --- a/app-registry.js +++ b/app-registry.js @@ -2,9 +2,12 @@ * Created by kenny on 16/3/28. */ 'use strict'; + import React, { - AppRegistry, Component, +} from 'react'; +import { + AppRegistry, Navigator, } from 'react-native'; diff --git a/framepage.js b/framepage.js index ae820a2..2c4c05f 100644 --- a/framepage.js +++ b/framepage.js @@ -3,8 +3,8 @@ */ 'use strict'; -import React, { - Component, +import React, { Component } from 'react'; +import { Dimensions, Image, View, diff --git a/index.android.js b/index.android.js index 0c463be..dbe9b8c 100644 --- a/index.android.js +++ b/index.android.js @@ -1,5 +1 @@ -/** - * Sample React Native App - * https://github.com/facebook/react-native - */ -import "./app-registry"; +import './launcher'; \ No newline at end of file diff --git a/index.ios.js b/index.ios.js index 0c463be..dbe9b8c 100644 --- a/index.ios.js +++ b/index.ios.js @@ -1,5 +1 @@ -/** - * Sample React Native App - * https://github.com/facebook/react-native - */ -import "./app-registry"; +import './launcher'; \ No newline at end of file diff --git a/ios/MyProject.xcodeproj/project.pbxproj b/ios/LagouApp.xcodeproj/project.pbxproj similarity index 90% rename from ios/MyProject.xcodeproj/project.pbxproj rename to ios/LagouApp.xcodeproj/project.pbxproj index 746970d..6e70f5b 100644 --- a/ios/MyProject.xcodeproj/project.pbxproj +++ b/ios/LagouApp.xcodeproj/project.pbxproj @@ -12,7 +12,7 @@ 00C302E81ABCBA2D00DB3ED1 /* libRCTImage.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302C01ABCB91800DB3ED1 /* libRCTImage.a */; }; 00C302E91ABCBA2D00DB3ED1 /* libRCTNetwork.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302DC1ABCB9D200DB3ED1 /* libRCTNetwork.a */; }; 00C302EA1ABCBA2D00DB3ED1 /* libRCTVibration.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302E41ABCB9EE00DB3ED1 /* libRCTVibration.a */; }; - 00E356F31AD99517003FC87E /* MyProjectTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* MyProjectTests.m */; }; + 00E356F31AD99517003FC87E /* LagouAppTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* LagouAppTests.m */; }; 133E29F31AD74F7200F7D852 /* libRCTLinking.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 78C398B91ACF4ADC00677621 /* libRCTLinking.a */; }; 139105C61AF99C1200B5F7CC /* libRCTSettings.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 139105C11AF99BAD00B5F7CC /* libRCTSettings.a */; }; 139FDEF61B0652A700C62182 /* libRCTWebSocket.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 139FDEF41B06529B00C62182 /* libRCTWebSocket.a */; }; @@ -20,6 +20,7 @@ 13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB11A68108700A75B9A /* LaunchScreen.xib */; }; 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; }; 13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; }; + 140ED2AC1D01E1AD002B40FF /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 146834041AC3E56700842450 /* libReact.a */; }; 146834051AC3E58100842450 /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 146834041AC3E56700842450 /* libReact.a */; }; 832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 832341B51AAA6A8300B99B32 /* libRCTText.a */; }; /* End PBXBuildFile section */ @@ -65,7 +66,7 @@ containerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */; proxyType = 1; remoteGlobalIDString = 13B07F861A680F5B00A75B9A; - remoteInfo = MyProject; + remoteInfo = LagouApp; }; 139105C01AF99BAD00B5F7CC /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; @@ -111,18 +112,18 @@ 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTImage.xcodeproj; path = ../node_modules/react-native/Libraries/Image/RCTImage.xcodeproj; sourceTree = ""; }; 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTNetwork.xcodeproj; path = ../node_modules/react-native/Libraries/Network/RCTNetwork.xcodeproj; sourceTree = ""; }; 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTVibration.xcodeproj; path = ../node_modules/react-native/Libraries/Vibration/RCTVibration.xcodeproj; sourceTree = ""; }; - 00E356EE1AD99517003FC87E /* MyProjectTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = MyProjectTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 00E356EE1AD99517003FC87E /* LagouAppTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = LagouAppTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 00E356F11AD99517003FC87E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 00E356F21AD99517003FC87E /* MyProjectTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MyProjectTests.m; sourceTree = ""; }; + 00E356F21AD99517003FC87E /* LagouAppTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = LagouAppTests.m; sourceTree = ""; }; 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTSettings.xcodeproj; path = ../node_modules/react-native/Libraries/Settings/RCTSettings.xcodeproj; sourceTree = ""; }; 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTWebSocket.xcodeproj; path = ../node_modules/react-native/Libraries/WebSocket/RCTWebSocket.xcodeproj; sourceTree = ""; }; - 13B07F961A680F5B00A75B9A /* MyProject.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = MyProject.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = MyProject/AppDelegate.h; sourceTree = ""; }; - 13B07FB01A68108700A75B9A /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AppDelegate.m; path = MyProject/AppDelegate.m; sourceTree = ""; }; + 13B07F961A680F5B00A75B9A /* LagouApp.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = LagouApp.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = LagouApp/AppDelegate.h; sourceTree = ""; }; + 13B07FB01A68108700A75B9A /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AppDelegate.m; path = LagouApp/AppDelegate.m; sourceTree = ""; }; 13B07FB21A68108700A75B9A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; - 13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = MyProject/Images.xcassets; sourceTree = ""; }; - 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = MyProject/Info.plist; sourceTree = ""; }; - 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = MyProject/main.m; sourceTree = ""; }; + 13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = LagouApp/Images.xcassets; sourceTree = ""; }; + 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = LagouApp/Info.plist; sourceTree = ""; }; + 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = LagouApp/main.m; sourceTree = ""; }; 146833FF1AC3E56700842450 /* React.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = React.xcodeproj; path = ../node_modules/react-native/React/React.xcodeproj; sourceTree = ""; }; 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTLinking.xcodeproj; path = ../node_modules/react-native/Libraries/LinkingIOS/RCTLinking.xcodeproj; sourceTree = ""; }; 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTText.xcodeproj; path = ../node_modules/react-native/Libraries/Text/RCTText.xcodeproj; sourceTree = ""; }; @@ -133,6 +134,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 140ED2AC1D01E1AD002B40FF /* libReact.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -196,13 +198,13 @@ name = Products; sourceTree = ""; }; - 00E356EF1AD99517003FC87E /* MyProjectTests */ = { + 00E356EF1AD99517003FC87E /* LagouAppTests */ = { isa = PBXGroup; children = ( - 00E356F21AD99517003FC87E /* MyProjectTests.m */, + 00E356F21AD99517003FC87E /* LagouAppTests.m */, 00E356F01AD99517003FC87E /* Supporting Files */, ); - path = MyProjectTests; + path = LagouAppTests; sourceTree = ""; }; 00E356F01AD99517003FC87E /* Supporting Files */ = { @@ -229,7 +231,7 @@ name = Products; sourceTree = ""; }; - 13B07FAE1A68108700A75B9A /* MyProject */ = { + 13B07FAE1A68108700A75B9A /* LagouApp */ = { isa = PBXGroup; children = ( 008F07F21AC5B25A0029DE68 /* main.jsbundle */, @@ -240,7 +242,7 @@ 13B07FB11A68108700A75B9A /* LaunchScreen.xib */, 13B07FB71A68108700A75B9A /* main.m */, ); - name = MyProject; + name = LagouApp; sourceTree = ""; }; 146834001AC3E56700842450 /* Products */ = { @@ -287,9 +289,9 @@ 83CBB9F61A601CBA00E9B192 = { isa = PBXGroup; children = ( - 13B07FAE1A68108700A75B9A /* MyProject */, + 13B07FAE1A68108700A75B9A /* LagouApp */, 832341AE1AAA6A7D00B99B32 /* Libraries */, - 00E356EF1AD99517003FC87E /* MyProjectTests */, + 00E356EF1AD99517003FC87E /* LagouAppTests */, 83CBBA001A601CBA00E9B192 /* Products */, ); indentWidth = 2; @@ -299,8 +301,8 @@ 83CBBA001A601CBA00E9B192 /* Products */ = { isa = PBXGroup; children = ( - 13B07F961A680F5B00A75B9A /* MyProject.app */, - 00E356EE1AD99517003FC87E /* MyProjectTests.xctest */, + 13B07F961A680F5B00A75B9A /* LagouApp.app */, + 00E356EE1AD99517003FC87E /* LagouAppTests.xctest */, ); name = Products; sourceTree = ""; @@ -308,9 +310,9 @@ /* End PBXGroup section */ /* Begin PBXNativeTarget section */ - 00E356ED1AD99517003FC87E /* MyProjectTests */ = { + 00E356ED1AD99517003FC87E /* LagouAppTests */ = { isa = PBXNativeTarget; - buildConfigurationList = 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "MyProjectTests" */; + buildConfigurationList = 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "LagouAppTests" */; buildPhases = ( 00E356EA1AD99517003FC87E /* Sources */, 00E356EB1AD99517003FC87E /* Frameworks */, @@ -321,14 +323,14 @@ dependencies = ( 00E356F51AD99517003FC87E /* PBXTargetDependency */, ); - name = MyProjectTests; - productName = MyProjectTests; - productReference = 00E356EE1AD99517003FC87E /* MyProjectTests.xctest */; + name = LagouAppTests; + productName = LagouAppTests; + productReference = 00E356EE1AD99517003FC87E /* LagouAppTests.xctest */; productType = "com.apple.product-type.bundle.unit-test"; }; - 13B07F861A680F5B00A75B9A /* MyProject */ = { + 13B07F861A680F5B00A75B9A /* LagouApp */ = { isa = PBXNativeTarget; - buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "MyProject" */; + buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "LagouApp" */; buildPhases = ( 13B07F871A680F5B00A75B9A /* Sources */, 13B07F8C1A680F5B00A75B9A /* Frameworks */, @@ -339,9 +341,9 @@ ); dependencies = ( ); - name = MyProject; + name = LagouApp; productName = "Hello World"; - productReference = 13B07F961A680F5B00A75B9A /* MyProject.app */; + productReference = 13B07F961A680F5B00A75B9A /* LagouApp.app */; productType = "com.apple.product-type.application"; }; /* End PBXNativeTarget section */ @@ -359,7 +361,7 @@ }; }; }; - buildConfigurationList = 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "MyProject" */; + buildConfigurationList = 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "LagouApp" */; compatibilityVersion = "Xcode 3.2"; developmentRegion = English; hasScannedForEncodings = 0; @@ -414,8 +416,8 @@ ); projectRoot = ""; targets = ( - 13B07F861A680F5B00A75B9A /* MyProject */, - 00E356ED1AD99517003FC87E /* MyProjectTests */, + 13B07F861A680F5B00A75B9A /* LagouApp */, + 00E356ED1AD99517003FC87E /* LagouAppTests */, ); }; /* End PBXProject section */ @@ -535,7 +537,7 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 00E356F31AD99517003FC87E /* MyProjectTests.m in Sources */, + 00E356F31AD99517003FC87E /* LagouAppTests.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -553,7 +555,7 @@ /* Begin PBXTargetDependency section */ 00E356F51AD99517003FC87E /* PBXTargetDependency */ = { isa = PBXTargetDependency; - target = 13B07F861A680F5B00A75B9A /* MyProject */; + target = 13B07F861A680F5B00A75B9A /* LagouApp */; targetProxy = 00E356F41AD99517003FC87E /* PBXContainerItemProxy */; }; /* End PBXTargetDependency section */ @@ -565,7 +567,7 @@ 13B07FB21A68108700A75B9A /* Base */, ); name = LaunchScreen.xib; - path = MyProject; + path = LagouApp; sourceTree = ""; }; /* End PBXVariantGroup section */ @@ -575,19 +577,15 @@ isa = XCBuildConfiguration; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; - FRAMEWORK_SEARCH_PATHS = ( - "$(SDKROOT)/Developer/Library/Frameworks", - "$(inherited)", - ); GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", "$(inherited)", ); - INFOPLIST_FILE = MyProjectTests/Info.plist; + INFOPLIST_FILE = LagouAppTests/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 8.2; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_NAME = "$(TARGET_NAME)"; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/MyProject.app/MyProject"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/LagouApp.app/LagouApp"; }; name = Debug; }; @@ -596,15 +594,11 @@ buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; COPY_PHASE_STRIP = NO; - FRAMEWORK_SEARCH_PATHS = ( - "$(SDKROOT)/Developer/Library/Frameworks", - "$(inherited)", - ); - INFOPLIST_FILE = MyProjectTests/Info.plist; + INFOPLIST_FILE = LagouAppTests/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 8.2; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_NAME = "$(TARGET_NAME)"; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/MyProject.app/MyProject"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/LagouApp.app/LagouApp"; }; name = Release; }; @@ -618,10 +612,14 @@ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, "$(SRCROOT)/../node_modules/react-native/React/**", ); - INFOPLIST_FILE = "MyProject/Info.plist"; + INFOPLIST_FILE = "LagouApp/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - OTHER_LDFLAGS = "-ObjC"; - PRODUCT_NAME = MyProject; + OTHER_LDFLAGS = ( + "$(inherited)", + "-ObjC", + "-lc++", + ); + PRODUCT_NAME = LagouApp; }; name = Debug; }; @@ -634,10 +632,14 @@ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, "$(SRCROOT)/../node_modules/react-native/React/**", ); - INFOPLIST_FILE = "MyProject/Info.plist"; + INFOPLIST_FILE = "LagouApp/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - OTHER_LDFLAGS = "-ObjC"; - PRODUCT_NAME = MyProject; + OTHER_LDFLAGS = ( + "$(inherited)", + "-ObjC", + "-lc++", + ); + PRODUCT_NAME = LagouApp; }; name = Release; }; @@ -730,7 +732,7 @@ /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ - 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "MyProjectTests" */ = { + 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "LagouAppTests" */ = { isa = XCConfigurationList; buildConfigurations = ( 00E356F61AD99517003FC87E /* Debug */, @@ -739,7 +741,7 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "MyProject" */ = { + 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "LagouApp" */ = { isa = XCConfigurationList; buildConfigurations = ( 13B07F941A680F5B00A75B9A /* Debug */, @@ -748,7 +750,7 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "MyProject" */ = { + 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "LagouApp" */ = { isa = XCConfigurationList; buildConfigurations = ( 83CBBA201A601CBA00E9B192 /* Debug */, diff --git a/ios/MyProject.xcodeproj/xcshareddata/xcschemes/MyProject.xcscheme b/ios/LagouApp.xcodeproj/xcshareddata/xcschemes/LagouApp.xcscheme similarity index 77% rename from ios/MyProject.xcodeproj/xcshareddata/xcschemes/MyProject.xcscheme rename to ios/LagouApp.xcodeproj/xcshareddata/xcschemes/LagouApp.xcscheme index 9e60a08..a52c372 100644 --- a/ios/MyProject.xcodeproj/xcshareddata/xcschemes/MyProject.xcscheme +++ b/ios/LagouApp.xcodeproj/xcshareddata/xcschemes/LagouApp.xcscheme @@ -15,9 +15,9 @@ + BuildableName = "LagouApp.app" + BlueprintName = "LagouApp" + ReferencedContainer = "container:LagouApp.xcodeproj"> + BuildableName = "LagouAppTests.xctest" + BlueprintName = "LagouAppTests" + ReferencedContainer = "container:LagouApp.xcodeproj"> @@ -47,9 +47,9 @@ + BuildableName = "LagouAppTests.xctest" + BlueprintName = "LagouAppTests" + ReferencedContainer = "container:LagouApp.xcodeproj"> @@ -57,9 +57,9 @@ + BuildableName = "LagouApp.app" + BlueprintName = "LagouApp" + ReferencedContainer = "container:LagouApp.xcodeproj"> @@ -77,9 +77,9 @@ + BuildableName = "LagouApp.app" + BlueprintName = "LagouApp" + ReferencedContainer = "container:LagouApp.xcodeproj"> @@ -96,9 +96,9 @@ + BuildableName = "LagouApp.app" + BlueprintName = "LagouApp" + ReferencedContainer = "container:LagouApp.xcodeproj"> diff --git a/ios/MyProject/AppDelegate.h b/ios/LagouApp/AppDelegate.h similarity index 100% rename from ios/MyProject/AppDelegate.h rename to ios/LagouApp/AppDelegate.h diff --git a/ios/MyProject/AppDelegate.m b/ios/LagouApp/AppDelegate.m similarity index 57% rename from ios/MyProject/AppDelegate.m rename to ios/LagouApp/AppDelegate.m index 2efa26f..0df376b 100644 --- a/ios/MyProject/AppDelegate.m +++ b/ios/LagouApp/AppDelegate.m @@ -9,6 +9,7 @@ #import "AppDelegate.h" +#import "RCTBundleURLProvider.h" #import "RCTRootView.h" @implementation AppDelegate @@ -17,34 +18,13 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:( { NSURL *jsCodeLocation; - /** - * Loading JavaScript code - uncomment the one you want. - * - * OPTION 1 - * Load from development server. Start the server from the repository root: - * - * $ npm start - * - * To run on device, change `localhost` to the IP address of your computer - * (you can get this by typing `ifconfig` into the terminal and selecting the - * `inet` value under `en0:`) and make sure your computer and iOS device are - * on the same Wi-Fi network. - */ - - jsCodeLocation = [NSURL URLWithString:@"http://localhost:8081/index.ios.bundle?platform=ios&dev=true"]; - - /** - * OPTION 2 - * Load from pre-bundled file on disk. The static bundle is automatically - * generated by "Bundle React Native code and images" build step. - */ - -// jsCodeLocation = [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"]; + jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index.ios" fallbackResource:nil]; RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation moduleName:@"LagouApp" initialProperties:nil launchOptions:launchOptions]; + rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1]; self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; UIViewController *rootViewController = [UIViewController new]; diff --git a/ios/MyProject/Base.lproj/LaunchScreen.xib b/ios/LagouApp/Base.lproj/LaunchScreen.xib similarity index 87% rename from ios/MyProject/Base.lproj/LaunchScreen.xib rename to ios/LagouApp/Base.lproj/LaunchScreen.xib index 0b1125c..bb83a32 100644 --- a/ios/MyProject/Base.lproj/LaunchScreen.xib +++ b/ios/LagouApp/Base.lproj/LaunchScreen.xib @@ -12,13 +12,13 @@ -