diff --git a/README.md b/README.md index fb529b2..c2bd83d 100644 --- a/README.md +++ b/README.md @@ -39,9 +39,7 @@ Check the example below, where an additional View-Component is used to display t * Sample React Native App * https://github.com/facebook/react-native */ -import React, { - Component, -} +import React, { Component } from 'react'; import { AppRegistry, StyleSheet, @@ -52,7 +50,7 @@ import { import ADBannerView from 'react-native-adbannerview'; class Example extends Component { - didLoadAd () { + didLoadAd() { console.log('Ad loaded') } didFailToReceiveAdWithError() { @@ -73,7 +71,7 @@ class Example extends Component { Cmd+D or shake for dev menu - {}}/> + {}} /> ); } diff --git a/example/.buckconfig b/example/.buckconfig new file mode 100644 index 0000000..934256c --- /dev/null +++ b/example/.buckconfig @@ -0,0 +1,6 @@ + +[android] + target = Google Inc.:Google APIs:23 + +[maven_repositories] + central = https://repo1.maven.org/maven2 diff --git a/example/.flowconfig b/example/.flowconfig index 8eadd33..8e838d9 100644 --- a/example/.flowconfig +++ b/example/.flowconfig @@ -14,17 +14,19 @@ # Ignore react and fbjs where there are overlaps, but don't ignore # anything that react-native relies on -.*/node_modules/fbjs-haste/.*/__tests__/.* -.*/node_modules/fbjs-haste/__forks__/Map.js -.*/node_modules/fbjs-haste/__forks__/Promise.js -.*/node_modules/fbjs-haste/__forks__/fetch.js -.*/node_modules/fbjs-haste/core/ExecutionEnvironment.js -.*/node_modules/fbjs-haste/core/isEmpty.js -.*/node_modules/fbjs-haste/crypto/crc32.js -.*/node_modules/fbjs-haste/stubs/ErrorUtils.js -.*/node_modules/react-haste/React.js -.*/node_modules/react-haste/renderers/dom/ReactDOM.js -.*/node_modules/react-haste/renderers/shared/event/eventPlugins/ResponderEventPlugin.js +.*/node_modules/fbjs/lib/Map.js +.*/node_modules/fbjs/lib/ErrorUtils.js + +# 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 + +.*/__mocks__/.* +.*/__tests__/.* + +.*/commoner/test/source/widget/share.js # Ignore commoner tests .*/node_modules/commoner/test/.* @@ -38,26 +40,55 @@ # Ignore Website .*/website/.* +# Ignore generators +.*/local-cli/generator.* + +# Ignore BUCK generated folders +.*\.buckd/ + +.*/node_modules/is-my-json-valid/test/.*\.json +.*/node_modules/iconv-lite/encodings/tables/.*\.json +.*/node_modules/y18n/test/.*\.json +.*/node_modules/spdx-license-ids/spdx-license-ids.json +.*/node_modules/spdx-exceptions/index.json +.*/node_modules/resolve/test/subdirs/node_modules/a/b/c/x.json +.*/node_modules/resolve/lib/core.json +.*/node_modules/jsonparse/samplejson/.*\.json +.*/node_modules/json5/test/.*\.json +.*/node_modules/ua-parser-js/test/.*\.json +.*/node_modules/builtin-modules/builtin-modules.json +.*/node_modules/binary-extensions/binary-extensions.json +.*/node_modules/url-regex/tlds.json +.*/node_modules/joi/.*\.json +.*/node_modules/isemail/.*\.json +.*/node_modules/tr46/.*\.json + + [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 + munge_underscores=true module.name_mapper='^image![a-zA-Z0-9$_-]+$' -> 'GlobalImageStub' -module.name_mapper='^[./a-zA-Z0-9$_-]+\.png$' -> '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\\.\\(1[0-8]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\) -suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(1[0-8]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)? #[0-9]+ +suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(2[0-4]\\|1[0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\) +suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(2[0-4]\\|1[0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+ suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy [version] -0.18.1 +0.24.0 diff --git a/example/.gitignore b/example/.gitignore index 94fc867..42c9490 100644 --- a/example/.gitignore +++ b/example/.gitignore @@ -32,3 +32,9 @@ local.properties # node_modules/ npm-debug.log + +# BUCK +buck-out/ +\.buckd/ +android/app/libs +android/keystores/debug.keystore diff --git a/example/android/app/BUCK b/example/android/app/BUCK new file mode 100644 index 0000000..d73aebd --- /dev/null +++ b/example/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.example', +) + +android_resource( + name = 'res', + res = 'src/main/res', + package = 'com.example', +) + +android_binary( + name = 'app', + package_type = 'debug', + manifest = 'src/main/AndroidManifest.xml', + keystore = '//android/keystores:debug', + deps = [ + ':app-code', + ], +) diff --git a/example/android/app/build.gradle b/example/android/app/build.gradle index 69a5277..1566309 100644 --- a/example/android/app/build.gradle +++ b/example/android/app/build.gradle @@ -1,12 +1,15 @@ apply plugin: "com.android.application" +import com.android.build.OutputFile + /** - * The react.gradle file registers two tasks: bundleDebugJsAndAssets and bundleReleaseJsAndAssets. + * The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets + * and bundleReleaseJsAndAssets). * These basically call `react-native bundle` with the correct arguments during the Android build * 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 @@ -21,6 +24,15 @@ apply plugin: "com.android.application" * // whether to bundle JS and assets in release mode * bundleInRelease: true, * + * // whether to bundle JS and assets in another build variant (if configured). + * // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants + * // The configuration property can be in the following formats + * // 'bundleIn${productFlavor}${buildType}' + * // 'bundleIn${buildType}' + * // bundleInFreeDebug: true, + * // bundleInPaidRelease: true, + * // bundleInBeta: true, + * * // the root of your project, i.e. where "package.json" lives * root: "../../", * @@ -47,7 +59,22 @@ apply plugin: "com.android.application" * ] */ -apply from: "react.gradle" +apply from: "../../node_modules/react-native/react.gradle" + +/** + * Set this to true to create two separate APKs instead of one: + * - An APK that only works on ARM devices + * - An APK that only works on x86 devices + * The advantage is the size of the APK is reduced by about 4MB. + * Upload all the APKs to the Play Store and people will download + * the correct one based on the CPU architecture of their device. + */ +def enableSeparateBuildPerCPUArchitecture = false + +/** + * Run Proguard to shrink the Java bytecode in release builds. + */ +def enableProguardInReleaseBuilds = false android { compileSdkVersion 23 @@ -63,16 +90,44 @@ android { abiFilters "armeabi-v7a", "x86" } } + splits { + abi { + reset() + enable enableSeparateBuildPerCPUArchitecture + universalApk false // If true, also generate a universal APK + include "armeabi-v7a", "x86" + } + } buildTypes { release { - minifyEnabled false // Set this to true to enable Proguard + minifyEnabled enableProguardInReleaseBuilds proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro" } } + // applicationVariants are e.g. debug, release + applicationVariants.all { variant -> + variant.outputs.each { output -> + // For each separate APK per architecture, set a unique version code as described here: + // http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits + def versionCodes = ["armeabi-v7a":1, "x86":2] + def abi = output.getFilter(OutputFile.ABI) + if (abi != null) { // null for the universal-debug, universal-release variants + output.versionCodeOverride = + versionCodes.get(abi) * 1048576 + defaultConfig.versionCode + } + } + } } dependencies { compile fileTree(dir: "libs", include: ["*.jar"]) compile "com.android.support:appcompat-v7:23.0.1" - compile "com.facebook.react:react-native:0.16.+" + 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/example/android/app/proguard-rules.pro b/example/android/app/proguard-rules.pro index ffa8c9f..347a13c 100644 --- a/example/android/app/proguard-rules.pro +++ b/example/android/app/proguard-rules.pro @@ -40,9 +40,12 @@ -keep class * extends com.facebook.react.bridge.JavaScriptModule { *; } -keep class * extends com.facebook.react.bridge.NativeModule { *; } +-keepclassmembers,includedescriptorclasses class * { native ; } -keepclassmembers class * { @com.facebook.react.uimanager.UIProp ; } --keepclassmembers class * { @com.facebook.react.uimanager.ReactProp ; } --keepclassmembers class * { @com.facebook.react.uimanager.ReactPropGroup ; } +-keepclassmembers class * { @com.facebook.react.uimanager.annotations.ReactProp ; } +-keepclassmembers class * { @com.facebook.react.uimanager.annotations.ReactPropGroup ; } + +-dontwarn com.facebook.react.** # okhttp diff --git a/example/android/app/react.gradle b/example/android/app/react.gradle deleted file mode 100644 index 1e08b00..0000000 --- a/example/android/app/react.gradle +++ /dev/null @@ -1,87 +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 jsBundleDirDebug = elvisFile(config.jsBundleDirDebug) ?: - file("$buildDir/intermediates/assets/debug") -def jsBundleDirRelease = elvisFile(config.jsBundleDirRelease) ?: - file("$buildDir/intermediates/assets/release") -def resourcesDirDebug = elvisFile(config.resourcesDirDebug) ?: - file("$buildDir/intermediates/res/merged/debug") -def resourcesDirRelease = elvisFile(config.resourcesDirRelease) ?: - file("$buildDir/intermediates/res/merged/release") -def inputExcludes = config.inputExcludes ?: ["android/**", "ios/**"] - -def jsBundleFileDebug = file("$jsBundleDirDebug/$bundleAssetName") -def jsBundleFileRelease = file("$jsBundleDirRelease/$bundleAssetName") - -task bundleDebugJsAndAssets(type: Exec) { - // create dirs if they are not there (e.g. the "clean" task just ran) - doFirst { - jsBundleDirDebug.mkdirs() - resourcesDirDebug.mkdirs() - } - - // set up inputs and outputs so gradle can cache the result - inputs.files fileTree(dir: reactRoot, excludes: inputExcludes) - outputs.dir jsBundleDirDebug - outputs.dir resourcesDirDebug - - // set up the call to the react-native cli - workingDir reactRoot - if (Os.isFamily(Os.FAMILY_WINDOWS)) { - commandLine "cmd", "/c", "react-native", "bundle", "--platform", "android", "--dev", "true", "--entry-file", - entryFile, "--bundle-output", jsBundleFileDebug, "--assets-dest", resourcesDirDebug - } else { - commandLine "react-native", "bundle", "--platform", "android", "--dev", "true", "--entry-file", - entryFile, "--bundle-output", jsBundleFileDebug, "--assets-dest", resourcesDirDebug - } - - enabled config.bundleInDebug ?: false -} - -task bundleReleaseJsAndAssets(type: Exec) { - // create dirs if they are not there (e.g. the "clean" task just ran) - doFirst { - jsBundleDirRelease.mkdirs() - resourcesDirRelease.mkdirs() - } - - // set up inputs and outputs so gradle can cache the result - inputs.files fileTree(dir: reactRoot, excludes: inputExcludes) - outputs.dir jsBundleDirRelease - outputs.dir resourcesDirRelease - - // set up the call to the react-native cli - workingDir reactRoot - if (Os.isFamily(Os.FAMILY_WINDOWS)) { - commandLine "cmd","/c", "react-native", "bundle", "--platform", "android", "--dev", "false", "--entry-file", - entryFile, "--bundle-output", jsBundleFileRelease, "--assets-dest", resourcesDirRelease - } else { - commandLine "react-native", "bundle", "--platform", "android", "--dev", "false", "--entry-file", - entryFile, "--bundle-output", jsBundleFileRelease, "--assets-dest", resourcesDirRelease - } - - enabled config.bundleInRelease ?: true -} - -gradle.projectsEvaluated { - // hook bundleDebugJsAndAssets into the android build process - bundleDebugJsAndAssets.dependsOn mergeDebugResources - bundleDebugJsAndAssets.dependsOn mergeDebugAssets - processDebugResources.dependsOn bundleDebugJsAndAssets - - // hook bundleReleaseJsAndAssets into the android build process - bundleReleaseJsAndAssets.dependsOn mergeReleaseResources - bundleReleaseJsAndAssets.dependsOn mergeReleaseAssets - processReleaseResources.dependsOn bundleReleaseJsAndAssets -} diff --git a/example/android/app/src/main/AndroidManifest.xml b/example/android/app/src/main/AndroidManifest.xml index 99e1c9b..f183347 100644 --- a/example/android/app/src/main/AndroidManifest.xml +++ b/example/android/app/src/main/AndroidManifest.xml @@ -1,7 +1,14 @@ + package="com.example" + android:versionCode="1" + android:versionName="1.0"> + + + getPackages() { + return Arrays.asList( + new MainReactPackage() + ); } } diff --git a/example/android/build.gradle b/example/android/build.gradle index bdb0fcc..403a007 100644 --- a/example/android/build.gradle +++ b/example/android/build.gradle @@ -16,8 +16,9 @@ allprojects { repositories { mavenLocal() jcenter() - jcenter { - url "http://dl.bintray.com/mkonicek/maven" + maven { + // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm + url "$projectDir/../../node_modules/react-native/android" } } } diff --git a/example/android/keystores/BUCK b/example/android/keystores/BUCK new file mode 100644 index 0000000..15da20e --- /dev/null +++ b/example/android/keystores/BUCK @@ -0,0 +1,8 @@ +keystore( + name = 'debug', + store = 'debug.keystore', + properties = 'debug.keystore.properties', + visibility = [ + 'PUBLIC', + ], +) diff --git a/example/android/keystores/debug.keystore.properties b/example/android/keystores/debug.keystore.properties new file mode 100644 index 0000000..121bfb4 --- /dev/null +++ b/example/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/example/index.android.js b/example/index.android.js index ae6cedd..12856bc 100644 --- a/example/index.android.js +++ b/example/index.android.js @@ -2,18 +2,17 @@ * Sample React Native App * https://github.com/facebook/react-native */ -'use strict'; -var React = require('react-native'); -var { +import React, { Component } from 'react'; +import { AppRegistry, StyleSheet, Text, - View, -} = React; + View +} from 'react-native'; -var example = React.createClass({ - render: function() { +class example extends Component { + render() { return ( @@ -28,9 +27,9 @@ var example = React.createClass({ ); } -}); +} -var styles = StyleSheet.create({ +const styles = StyleSheet.create({ container: { flex: 1, justifyContent: 'center', diff --git a/example/index.ios.js b/example/index.ios.js index 3cd8c10..5e327ac 100644 --- a/example/index.ios.js +++ b/example/index.ios.js @@ -1,10 +1,12 @@ /** * Sample React Native App * https://github.com/facebook/react-native + * @flow */ -import React, { + +import React, { Component } from 'react'; +import { AppRegistry, - Component, StyleSheet, Text, View, @@ -12,12 +14,12 @@ import React, { import ADBannerView from 'react-native-adbannerview'; -class Example extends Component { - didLoadAd () { - console.log('Ad loaded') +class example extends Component { + didLoadAd() { + console.log('Ad loaded'); } didFailToReceiveAdWithError() { - console.log('Error loading ad') + console.log('Error loading ad'); } render() { return ( @@ -34,15 +36,15 @@ class Example extends Component { Cmd+D or shake for dev menu - {}}/> + {}} /> ); } -}; +} const styles = StyleSheet.create({ stage: { - flex: 1 + flex: 1, }, container: { flex: 1, @@ -59,7 +61,7 @@ const styles = StyleSheet.create({ textAlign: 'center', color: '#333333', marginBottom: 5, - } + }, }); -AppRegistry.registerComponent('example', () => Example); +AppRegistry.registerComponent('example', () => example); diff --git a/example/ios/example.xcodeproj/project.pbxproj b/example/ios/example.xcodeproj/project.pbxproj index 92350b3..476d97b 100644 --- a/example/ios/example.xcodeproj/project.pbxproj +++ b/example/ios/example.xcodeproj/project.pbxproj @@ -22,7 +22,7 @@ 13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; }; 146834051AC3E58100842450 /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 146834041AC3E56700842450 /* libReact.a */; }; 832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 832341B51AAA6A8300B99B32 /* libRCTText.a */; }; - CD83BEBE1C1CF49A00877FB0 /* libADBannerViewManager.a in Frameworks */ = {isa = PBXBuildFile; fileRef = CD83BEB31C1CF49100877FB0 /* libADBannerViewManager.a */; }; + CDBE01E01D04930D00CDD703 /* libADBannerViewManager.a in Frameworks */ = {isa = PBXBuildFile; fileRef = CDBE01D51D04930400CDD703 /* libADBannerViewManager.a */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -103,9 +103,9 @@ remoteGlobalIDString = 58B5119B1A9E6C1200147676; remoteInfo = RCTText; }; - CD83BEB21C1CF49100877FB0 /* PBXContainerItemProxy */ = { + CDBE01D41D04930400CDD703 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; - containerPortal = CD83BEAE1C1CF49100877FB0 /* ADBannerViewManager.xcodeproj */; + containerPortal = CDBE01D01D04930300CDD703 /* ADBannerViewManager.xcodeproj */; proxyType = 2; remoteGlobalIDString = 134814201AA4EA6300B7C361; remoteInfo = ADBannerViewManager; @@ -134,7 +134,7 @@ 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 = ""; }; - CD83BEAE1C1CF49100877FB0 /* ADBannerViewManager.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = ADBannerViewManager.xcodeproj; path = "../node_modules/react-native-adbannerview/lib/ADBannerViewManager.xcodeproj"; sourceTree = ""; }; + CDBE01D01D04930300CDD703 /* ADBannerViewManager.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = ADBannerViewManager.xcodeproj; path = "../node_modules/react-native-adbannerview/lib/ADBannerViewManager.xcodeproj"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -149,7 +149,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - CD83BEBE1C1CF49A00877FB0 /* libADBannerViewManager.a in Frameworks */, + CDBE01E01D04930D00CDD703 /* libADBannerViewManager.a in Frameworks */, 146834051AC3E58100842450 /* libReact.a in Frameworks */, 00C302E51ABCBA2D00DB3ED1 /* libRCTActionSheet.a in Frameworks */, 00C302E71ABCBA2D00DB3ED1 /* libRCTGeolocation.a in Frameworks */, @@ -272,7 +272,7 @@ 832341AE1AAA6A7D00B99B32 /* Libraries */ = { isa = PBXGroup; children = ( - CD83BEAE1C1CF49100877FB0 /* ADBannerViewManager.xcodeproj */, + CDBE01D01D04930300CDD703 /* ADBannerViewManager.xcodeproj */, 146833FF1AC3E56700842450 /* React.xcodeproj */, 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */, 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */, @@ -316,10 +316,10 @@ name = Products; sourceTree = ""; }; - CD83BEAF1C1CF49100877FB0 /* Products */ = { + CDBE01D11D04930300CDD703 /* Products */ = { isa = PBXGroup; children = ( - CD83BEB31C1CF49100877FB0 /* libADBannerViewManager.a */, + CDBE01D51D04930400CDD703 /* libADBannerViewManager.a */, ); name = Products; sourceTree = ""; @@ -391,8 +391,8 @@ projectDirPath = ""; projectReferences = ( { - ProductGroup = CD83BEAF1C1CF49100877FB0 /* Products */; - ProjectRef = CD83BEAE1C1CF49100877FB0 /* ADBannerViewManager.xcodeproj */; + ProductGroup = CDBE01D11D04930300CDD703 /* Products */; + ProjectRef = CDBE01D01D04930300CDD703 /* ADBannerViewManager.xcodeproj */; }, { ProductGroup = 00C302A81ABCB8CE00DB3ED1 /* Products */; @@ -514,11 +514,11 @@ remoteRef = 832341B41AAA6A8300B99B32 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; - CD83BEB31C1CF49100877FB0 /* libADBannerViewManager.a */ = { + CDBE01D51D04930400CDD703 /* libADBannerViewManager.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; path = libADBannerViewManager.a; - remoteRef = CD83BEB21C1CF49100877FB0 /* PBXContainerItemProxy */; + remoteRef = CDBE01D41D04930400CDD703 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXReferenceProxy section */ @@ -555,7 +555,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "../node_modules/react-native/packager/react-native-xcode.sh"; + shellScript = "export NODE_BINARY=node\n../node_modules/react-native/packager/react-native-xcode.sh"; }; /* End PBXShellScriptBuildPhase section */ @@ -604,10 +604,6 @@ isa = XCBuildConfiguration; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; - FRAMEWORK_SEARCH_PATHS = ( - "$(SDKROOT)/Developer/Library/Frameworks", - "$(inherited)", - ); GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", "$(inherited)", @@ -625,10 +621,6 @@ buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; COPY_PHASE_STRIP = NO; - FRAMEWORK_SEARCH_PATHS = ( - "$(SDKROOT)/Developer/Library/Frameworks", - "$(inherited)", - ); INFOPLIST_FILE = exampleTests/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 8.2; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; @@ -649,7 +641,10 @@ ); INFOPLIST_FILE = example/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - OTHER_LDFLAGS = "-ObjC"; + OTHER_LDFLAGS = ( + "-ObjC", + "-lc++", + ); PRODUCT_NAME = example; }; name = Debug; @@ -665,7 +660,10 @@ ); INFOPLIST_FILE = example/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - OTHER_LDFLAGS = "-ObjC"; + OTHER_LDFLAGS = ( + "-ObjC", + "-lc++", + ); PRODUCT_NAME = example; }; name = Release; diff --git a/example/ios/example/AppDelegate.m b/example/ios/example/AppDelegate.m index ceaa988..2c4750a 100644 --- a/example/ios/example/AppDelegate.m +++ b/example/ios/example/AppDelegate.m @@ -36,7 +36,9 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:( /** * OPTION 2 * Load from pre-bundled file on disk. The static bundle is automatically - * generated by "Bundle React Native code and images" build step. + * 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"]; diff --git a/example/ios/example/Info.plist b/example/ios/example/Info.plist index cddf076..91963b2 100644 --- a/example/ios/example/Info.plist +++ b/example/ios/example/Info.plist @@ -40,7 +40,7 @@ NSAppTransportSecurity - + NSAllowsArbitraryLoads diff --git a/example/ios/exampleTests/exampleTests.m b/example/ios/exampleTests/exampleTests.m index 42effd8..4a4c307 100644 --- a/example/ios/exampleTests/exampleTests.m +++ b/example/ios/exampleTests/exampleTests.m @@ -13,7 +13,7 @@ #import "RCTLog.h" #import "RCTRootView.h" -#define TIMEOUT_SECONDS 240 +#define TIMEOUT_SECONDS 600 #define TEXT_TO_LOOK_FOR @"Welcome to React Native!" @interface exampleTests : XCTestCase diff --git a/example/package.json b/example/package.json index 0724bdb..28d3ba7 100644 --- a/example/package.json +++ b/example/package.json @@ -3,10 +3,11 @@ "version": "0.0.1", "private": true, "scripts": { - "start": "react-native start" + "start": "node node_modules/react-native/local-cli/cli.js start" }, "dependencies": { - "react-native": "^0.17.0", - "react-native-adbannerview": "^1.3.0" + "react": "15.0.2", + "react-native": "^0.26.3", + "react-native-adbannerview": "^1.4.0" } }