From c01dd8a7e88b0c0aefa11009b64791d1d0abe601 Mon Sep 17 00:00:00 2001 From: xwenliang Date: Mon, 19 Sep 2016 19:49:39 +0800 Subject: [PATCH] example debug --- example/PickerTest/android/app/BUCK | 2 +- example/PickerTest/android/app/build.gradle | 9 +- .../PickerTest/android/app/proguard-rules.pro | 9 +- .../android/app/src/main/AndroidManifest.xml | 1 + .../java/com/pickertest/MainActivity.java | 25 ----- .../java/com/pickertest/MainApplication.java | 37 ++++++++ .../app/src/main/res/values/strings.xml | 1 + example/PickerTest/android/build.gradle | 2 +- example/PickerTest/android/settings.gradle | 2 + example/PickerTest/index.android.js | 2 +- example/PickerTest/index.ios.js | 34 ++++--- .../ios/PickerTest.xcodeproj/project.pbxproj | 92 ++++++++++++++----- .../PickerTest/ios/PickerTest/AppDelegate.m | 28 +----- example/PickerTest/ios/PickerTest/Info.plist | 18 ++-- example/PickerTest/package.json | 4 +- 15 files changed, 163 insertions(+), 103 deletions(-) create mode 100644 example/PickerTest/android/app/src/main/java/com/pickertest/MainApplication.java diff --git a/example/PickerTest/android/app/BUCK b/example/PickerTest/android/app/BUCK index 5719fa8..653e71c 100644 --- a/example/PickerTest/android/app/BUCK +++ b/example/PickerTest/android/app/BUCK @@ -5,7 +5,7 @@ import re # - 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` +# - `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 # diff --git a/example/PickerTest/android/app/build.gradle b/example/PickerTest/android/app/build.gradle index ce195b6..20167c9 100644 --- a/example/PickerTest/android/app/build.gradle +++ b/example/PickerTest/android/app/build.gradle @@ -55,7 +55,13 @@ 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: [] * ] */ @@ -120,6 +126,7 @@ android { } dependencies { + compile project(':react-native-picker') compile fileTree(dir: "libs", include: ["*.jar"]) compile "com.android.support:appcompat-v7:23.0.1" compile "com.facebook.react:react-native:+" // From node_modules diff --git a/example/PickerTest/android/app/proguard-rules.pro b/example/PickerTest/android/app/proguard-rules.pro index 347a13c..48361a9 100644 --- a/example/PickerTest/android/app/proguard-rules.pro +++ b/example/PickerTest/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 diff --git a/example/PickerTest/android/app/src/main/AndroidManifest.xml b/example/PickerTest/android/app/src/main/AndroidManifest.xml index ed8fb3a..947ea8a 100644 --- a/example/PickerTest/android/app/src/main/AndroidManifest.xml +++ b/example/PickerTest/android/app/src/main/AndroidManifest.xml @@ -11,6 +11,7 @@ android:targetSdkVersion="22" /> getPackages() { - return Arrays.asList( - new MainReactPackage() - ); - } } diff --git a/example/PickerTest/android/app/src/main/java/com/pickertest/MainApplication.java b/example/PickerTest/android/app/src/main/java/com/pickertest/MainApplication.java new file mode 100644 index 0000000..9813b89 --- /dev/null +++ b/example/PickerTest/android/app/src/main/java/com/pickertest/MainApplication.java @@ -0,0 +1,37 @@ +package com.pickertest; + +import android.app.Application; +import android.util.Log; + +import com.facebook.react.ReactApplication; +import com.beefe.picker.PickerViewPackage; +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(), + new PickerViewPackage() + ); + } + }; + + @Override + public ReactNativeHost getReactNativeHost() { + return mReactNativeHost; + } +} diff --git a/example/PickerTest/android/app/src/main/res/values/strings.xml b/example/PickerTest/android/app/src/main/res/values/strings.xml index 73222bb..f27af60 100644 --- a/example/PickerTest/android/app/src/main/res/values/strings.xml +++ b/example/PickerTest/android/app/src/main/res/values/strings.xml @@ -1,3 +1,4 @@ + PickerTest diff --git a/example/PickerTest/android/build.gradle b/example/PickerTest/android/build.gradle index 403a007..fcba4c5 100644 --- a/example/PickerTest/android/build.gradle +++ b/example/PickerTest/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/example/PickerTest/android/settings.gradle b/example/PickerTest/android/settings.gradle index 554252a..f7f9ddd 100644 --- a/example/PickerTest/android/settings.gradle +++ b/example/PickerTest/android/settings.gradle @@ -1,3 +1,5 @@ rootProject.name = 'PickerTest' include ':app' +include ':react-native-picker' +project(':react-native-picker').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-picker/android') diff --git a/example/PickerTest/index.android.js b/example/PickerTest/index.android.js index eace275..3c28eff 100644 --- a/example/PickerTest/index.android.js +++ b/example/PickerTest/index.android.js @@ -3,7 +3,7 @@ * https://github.com/facebook/react-native */ -import React, {Component} from 'react' +import React, {Component} from 'react'; import { View, Text, diff --git a/example/PickerTest/index.ios.js b/example/PickerTest/index.ios.js index 29c6041..3c28eff 100644 --- a/example/PickerTest/index.ios.js +++ b/example/PickerTest/index.ios.js @@ -3,7 +3,7 @@ * https://github.com/facebook/react-native */ -import React, {Component} from 'react' +import React, {Component} from 'react'; import { View, Text, @@ -50,27 +50,31 @@ class PickerTest extends Component { } _onPressHandle() { - this.picker.toggle(); + Picker.init({ + pickerData: createDateData(), + selectedValue: ['2015年', '12月', '12日'], + onPickerConfirm: pickedValue => { + alert(JSON.stringify(pickedValue)); + console.log(pickedValue); + }, + onPickerCancel: pickedValue => { + alert(JSON.stringify(pickedValue)); + console.log(pickedValue); + }, + onPickerSelect: pickedValue => { + alert(JSON.stringify(pickedValue)); + console.log(pickedValue); + } + }); + Picker.show(); } - render(){ + render() { return ( Click Me - this.picker = picker} - style={{height: 260}} - showMask={true} - showDuration={300} - pickerData={createDateData()} - selectedValue={['2015年', '12月', '12日']} - onPickerDone={(pickedValue) => { - alert(JSON.stringify(pickedValue)); - console.log(pickedValue); - }} - /> ); } diff --git a/example/PickerTest/ios/PickerTest.xcodeproj/project.pbxproj b/example/PickerTest/ios/PickerTest.xcodeproj/project.pbxproj index bdef40d..0dbae7b 100644 --- a/example/PickerTest/ios/PickerTest.xcodeproj/project.pbxproj +++ b/example/PickerTest/ios/PickerTest.xcodeproj/project.pbxproj @@ -20,7 +20,9 @@ 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 */; }; + 4166227E001449A3BF2B31BB /* libRCTBEEPickerManager.a in Frameworks */ = {isa = PBXBuildFile; fileRef = C4E031C45A2D4A2FBD2BD3AD /* libRCTBEEPickerManager.a */; }; 832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 832341B51AAA6A8300B99B32 /* libRCTText.a */; }; /* End PBXBuildFile section */ @@ -102,20 +104,27 @@ remoteGlobalIDString = 58B5119B1A9E6C1200147676; remoteInfo = RCTText; }; + D8FD166B1D90078200508B34 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 61B8CE8F838D4F69BDD6233C /* RCTBEEPickerManager.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 17D41E551D7EE0CA0031415E; + remoteInfo = RCTBEEPickerManager; + }; /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ - 008F07F21AC5B25A0029DE68 /* main.jsbundle */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = main.jsbundle; path = main.jsbundle; sourceTree = ""; }; - 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTActionSheet.xcodeproj; path = ../node_modules/react-native/Libraries/ActionSheetIOS/RCTActionSheet.xcodeproj; sourceTree = ""; }; - 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTGeolocation.xcodeproj; path = ../node_modules/react-native/Libraries/Geolocation/RCTGeolocation.xcodeproj; sourceTree = ""; }; - 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 = ""; }; + 008F07F21AC5B25A0029DE68 /* main.jsbundle */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = main.jsbundle; sourceTree = ""; }; + 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTActionSheet.xcodeproj; path = "../node_modules/react-native/Libraries/ActionSheetIOS/RCTActionSheet.xcodeproj"; sourceTree = ""; }; + 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTGeolocation.xcodeproj; path = "../node_modules/react-native/Libraries/Geolocation/RCTGeolocation.xcodeproj"; sourceTree = ""; }; + 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 /* PickerTestTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = PickerTestTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 00E356F11AD99517003FC87E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 00E356F21AD99517003FC87E /* PickerTestTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PickerTestTests.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 = ""; }; + 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 /* PickerTest.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = PickerTest.app; sourceTree = BUILT_PRODUCTS_DIR; }; 13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = PickerTest/AppDelegate.h; sourceTree = ""; }; 13B07FB01A68108700A75B9A /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AppDelegate.m; path = PickerTest/AppDelegate.m; sourceTree = ""; }; @@ -123,9 +132,11 @@ 13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = PickerTest/Images.xcassets; sourceTree = ""; }; 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = PickerTest/Info.plist; sourceTree = ""; }; 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = PickerTest/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 = ""; }; + 146833FF1AC3E56700842450 /* React.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = React.xcodeproj; path = "../node_modules/react-native/React/React.xcodeproj"; sourceTree = ""; }; + 61B8CE8F838D4F69BDD6233C /* RCTBEEPickerManager.xcodeproj */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = "wrapper.pb-project"; name = RCTBEEPickerManager.xcodeproj; path = "../node_modules/react-native-picker/ios/RCTBEEPickerManager.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 = ""; }; + C4E031C45A2D4A2FBD2BD3AD /* libRCTBEEPickerManager.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = libRCTBEEPickerManager.a; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -133,6 +144,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 140ED2AC1D01E1AD002B40FF /* libReact.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -150,6 +162,7 @@ 832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */, 00C302EA1ABCBA2D00DB3ED1 /* libRCTVibration.a in Frameworks */, 139FDEF61B0652A700C62182 /* libRCTWebSocket.a in Frameworks */, + 4166227E001449A3BF2B31BB /* libRCTBEEPickerManager.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -272,6 +285,7 @@ 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */, 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */, 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */, + 61B8CE8F838D4F69BDD6233C /* RCTBEEPickerManager.xcodeproj */, ); name = Libraries; sourceTree = ""; @@ -305,6 +319,14 @@ name = Products; sourceTree = ""; }; + D8FD16671D90078200508B34 /* Products */ = { + isa = PBXGroup; + children = ( + D8FD166C1D90078200508B34 /* libRCTBEEPickerManager.a */, + ); + name = Products; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -350,7 +372,7 @@ 83CBB9F71A601CBA00E9B192 /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0610; + LastUpgradeCheck = 610; ORGANIZATIONNAME = Facebook; TargetAttributes = { 00E356ED1AD99517003FC87E = { @@ -375,6 +397,10 @@ ProductGroup = 00C302A81ABCB8CE00DB3ED1 /* Products */; ProjectRef = 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */; }, + { + ProductGroup = D8FD16671D90078200508B34 /* Products */; + ProjectRef = 61B8CE8F838D4F69BDD6233C /* RCTBEEPickerManager.xcodeproj */; + }, { ProductGroup = 00C302B61ABCB90400DB3ED1 /* Products */; ProjectRef = 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */; @@ -491,6 +517,13 @@ remoteRef = 832341B41AAA6A8300B99B32 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; + D8FD166C1D90078200508B34 /* libRCTBEEPickerManager.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libRCTBEEPickerManager.a; + remoteRef = D8FD166B1D90078200508B34 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; /* End PBXReferenceProxy section */ /* Begin PBXResourcesBuildPhase section */ @@ -526,7 +559,6 @@ runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; shellScript = "export NODE_BINARY=node\n../node_modules/react-native/packager/react-native-xcode.sh"; - showEnvVarsInLog = 1; }; /* End PBXShellScriptBuildPhase section */ @@ -582,6 +614,10 @@ INFOPLIST_FILE = PickerTestTests/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 8.2; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "\"$(SRCROOT)/$(TARGET_NAME)\"", + ); PRODUCT_NAME = "$(TARGET_NAME)"; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/PickerTest.app/PickerTest"; }; @@ -595,6 +631,10 @@ INFOPLIST_FILE = PickerTestTests/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 8.2; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "\"$(SRCROOT)/$(TARGET_NAME)\"", + ); PRODUCT_NAME = "$(TARGET_NAME)"; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/PickerTest.app/PickerTest"; }; @@ -609,13 +649,15 @@ "$(inherited)", /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, "$(SRCROOT)/../node_modules/react-native/React/**", + "$(SRCROOT)/../node_modules/react-native-picker/ios/RCTBEEPickerManager", ); - INFOPLIST_FILE = "PickerTest/Info.plist"; + INFOPLIST_FILE = PickerTest/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - OTHER_LDFLAGS = ( - "-ObjC", - "-lc++", - ); + OTHER_LDFLAGS = ( + "$(inherited)", + "-ObjC", + "-lc++", + ); PRODUCT_NAME = PickerTest; }; name = Debug; @@ -628,13 +670,15 @@ "$(inherited)", /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, "$(SRCROOT)/../node_modules/react-native/React/**", + "$(SRCROOT)/../node_modules/react-native-picker/ios/RCTBEEPickerManager", ); - INFOPLIST_FILE = "PickerTest/Info.plist"; + INFOPLIST_FILE = PickerTest/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - OTHER_LDFLAGS = ( - "-ObjC", - "-lc++", - ); + OTHER_LDFLAGS = ( + "$(inherited)", + "-ObjC", + "-lc++", + ); PRODUCT_NAME = PickerTest; }; name = Release; @@ -677,6 +721,7 @@ "$(inherited)", /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, "$(SRCROOT)/../node_modules/react-native/React/**", + "$(SRCROOT)/../node_modules/react-native-picker/ios/RCTBEEPickerManager", ); IPHONEOS_DEPLOYMENT_TARGET = 7.0; MTL_ENABLE_DEBUG_INFO = YES; @@ -717,6 +762,7 @@ "$(inherited)", /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, "$(SRCROOT)/../node_modules/react-native/React/**", + "$(SRCROOT)/../node_modules/react-native-picker/ios/RCTBEEPickerManager", ); IPHONEOS_DEPLOYMENT_TARGET = 7.0; MTL_ENABLE_DEBUG_INFO = NO; diff --git a/example/PickerTest/ios/PickerTest/AppDelegate.m b/example/PickerTest/ios/PickerTest/AppDelegate.m index 6771e1e..e5eb3e8 100644 --- a/example/PickerTest/ios/PickerTest/AppDelegate.m +++ b/example/PickerTest/ios/PickerTest/AppDelegate.m @@ -9,6 +9,7 @@ #import "AppDelegate.h" +#import "RCTBundleURLProvider.h" #import "RCTRootView.h" @implementation AppDelegate @@ -17,36 +18,13 @@ { 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 the "Bundle React Native code and images" build step when - * running the project on an actual device or running the project on the - * simulator in the "Release" build configuration. - */ - -// jsCodeLocation = [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"]; + jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index.ios" fallbackResource:nil]; RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation moduleName:@"PickerTest" 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/example/PickerTest/ios/PickerTest/Info.plist b/example/PickerTest/ios/PickerTest/Info.plist index 91963b2..e98ebb0 100644 --- a/example/PickerTest/ios/PickerTest/Info.plist +++ b/example/PickerTest/ios/PickerTest/Info.plist @@ -38,11 +38,17 @@ NSLocationWhenInUseUsageDescription - NSAppTransportSecurity - - - NSAllowsArbitraryLoads - - + NSAppTransportSecurity + + + NSExceptionDomains + + localhost + + NSTemporaryExceptionAllowsInsecureHTTPLoads + + + + diff --git a/example/PickerTest/package.json b/example/PickerTest/package.json index bf925b5..03286b0 100644 --- a/example/PickerTest/package.json +++ b/example/PickerTest/package.json @@ -6,8 +6,8 @@ "start": "node_modules/react-native/packager/packager.sh" }, "dependencies": { - "react": "15.0.2", - "react-native": "^0.26.1", + "react": "15.3.1", + "react-native": "^0.32.0", "react-native-picker": "beefe/react-native-picker" } } -- 2.26.2