diff --git a/.flowconfig b/.flowconfig index 9bded78..47d80d9 100644 --- a/.flowconfig +++ b/.flowconfig @@ -24,7 +24,6 @@ [libs] node_modules/react-native/Libraries/react-native/react-native-interface.js node_modules/react-native/flow/ -node_modules/react-native/flow-github/ [options] emoji=true @@ -67,4 +66,4 @@ suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError [version] -^0.86.0 +^0.92.0 diff --git a/__tests__/App.js b/__tests__/App-test.js similarity index 86% rename from __tests__/App.js rename to __tests__/App-test.js index a79ec3d..1784766 100644 --- a/__tests__/App.js +++ b/__tests__/App-test.js @@ -1,6 +1,5 @@ /** * @format - * @lint-ignore-every XPLATJSCOPYRIGHT1 */ import 'react-native'; diff --git a/android/app/build.gradle b/android/app/build.gradle index 7b9de63..afcacdd 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -96,7 +96,11 @@ def enableProguardInReleaseBuilds = false android { compileSdkVersion rootProject.ext.compileSdkVersion - buildToolsVersion rootProject.ext.buildToolsVersion + + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } def getVersionCode = { -> return project.hasProperty('versionCode') ? Integer.parseInt(project.versionCode) : 1 @@ -125,7 +129,7 @@ android { reset() enable enableSeparateBuildPerCPUArchitecture universalApk false // If true, also generate a universal APK - include "armeabi-v7a", "x86", "arm64-v8a" + include "armeabi-v7a", "x86", "arm64-v8a", "x86_64" } } signingConfigs { @@ -166,7 +170,7 @@ android { 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, "arm64-v8a": 3] + def versionCodes = ["armeabi-v7a":1, "x86":2, "arm64-v8a": 3, "x86_64": 4] def abi = output.getFilter(OutputFile.ABI) if (abi != null) { // null for the universal-debug, universal-release variants output.versionCodeOverride = diff --git a/android/build.gradle b/android/build.gradle index e2a7d14..c4e6419 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -13,7 +13,7 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:3.2.1' + classpath("com.android.tools.build:gradle:3.4.0") // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files @@ -31,9 +31,3 @@ allprojects { } } } - - -task wrapper(type: Wrapper) { - gradleVersion = '4.7' - distributionUrl = distributionUrl.replace("bin", "all") -} diff --git a/android/gradle/wrapper/gradle-4.7-all.zip b/android/gradle/wrapper/gradle-5.4.1-all.zip similarity index 77% rename from android/gradle/wrapper/gradle-4.7-all.zip rename to android/gradle/wrapper/gradle-5.4.1-all.zip index 292b4fb..2c3a743 100644 Binary files a/android/gradle/wrapper/gradle-4.7-all.zip and b/android/gradle/wrapper/gradle-5.4.1-all.zip differ diff --git a/android/gradle/wrapper/gradle-wrapper.jar b/android/gradle/wrapper/gradle-wrapper.jar index 01b8bf6..5c2d1cf 100644 Binary files a/android/gradle/wrapper/gradle-wrapper.jar and b/android/gradle/wrapper/gradle-wrapper.jar differ diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties index 47c3249..a8c3690 100644 --- a/android/gradle/wrapper/gradle-wrapper.properties +++ b/android/gradle/wrapper/gradle-wrapper.properties @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=gradle-4.7-all.zip +distributionUrl=gradle-5.4.1-all.zip diff --git a/android/gradlew b/android/gradlew index cccdd3d..b0d6d0a 100644 --- a/android/gradlew +++ b/android/gradlew @@ -1,5 +1,21 @@ #!/usr/bin/env sh +# +# Copyright 2015 the original author or authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + ############################################################################## ## ## Gradle start up script for UN*X @@ -28,7 +44,7 @@ APP_NAME="Gradle" APP_BASE_NAME=`basename "$0"` # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS="" +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD="maximum" diff --git a/android/gradlew.bat b/android/gradlew.bat index e95643d..15e1ee3 100644 --- a/android/gradlew.bat +++ b/android/gradlew.bat @@ -1,3 +1,19 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem http://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + @if "%DEBUG%" == "" @echo off @rem ########################################################################## @rem @@ -14,7 +30,7 @@ set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS= +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" @rem Find java.exe if defined JAVA_HOME goto findJavaFromJavaHome diff --git a/android/settings.gradle b/android/settings.gradle index 080e5f7..399f0dc 100644 --- a/android/settings.gradle +++ b/android/settings.gradle @@ -1,9 +1,9 @@ rootProject.name = 'screenAd' include ':react-native-camera' -project(':react-native-camera').projectDir = new File(rootProject.projectDir, '..\\node_modules\\react-native-camera\\android') +project(':react-native-camera').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-camera/android') include ':react-native-device-info' -project(':react-native-device-info').projectDir = new File(rootProject.projectDir, '..\\node_modules\\react-native-device-info\\android') +project(':react-native-device-info').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-device-info/android') include ':react-native-code-push' -project(':react-native-code-push').projectDir = new File(rootProject.projectDir, '..\\node_modules\\react-native-code-push\\android\\app') +project(':react-native-code-push').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-code-push/android/app') include ':app' diff --git a/babel.config.js b/babel.config.js index b66a04a..f842b77 100644 --- a/babel.config.js +++ b/babel.config.js @@ -1,3 +1,3 @@ module.exports = { - presets: ["module:metro-react-native-babel-preset"] -} + presets: ['module:metro-react-native-babel-preset'], +}; diff --git a/index.js b/index.js index 3ac6652..a850d03 100644 --- a/index.js +++ b/index.js @@ -1,6 +1,5 @@ /** * @format - * @lint-ignore-every XPLATJSCOPYRIGHT1 */ import {AppRegistry} from 'react-native'; diff --git a/ios/screenAd.xcodeproj/project.pbxproj b/ios/screenAd.xcodeproj/project.pbxproj index 6de6d06..a67b30b 100644 --- a/ios/screenAd.xcodeproj/project.pbxproj +++ b/ios/screenAd.xcodeproj/project.pbxproj @@ -39,11 +39,11 @@ ADBDB9381DFEBF1600ED6528 /* libRCTBlob.a in Frameworks */ = {isa = PBXBuildFile; fileRef = ADBDB9271DFEBF0700ED6528 /* libRCTBlob.a */; }; ED297163215061F000B7C4FE /* JavaScriptCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = ED297162215061F000B7C4FE /* JavaScriptCore.framework */; }; ED2971652150620600B7C4FE /* JavaScriptCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = ED2971642150620600B7C4FE /* JavaScriptCore.framework */; }; - 84325BCA939E4E4E8090435C /* libCodePush.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 928B0784CE244B05BADC60D9 /* libCodePush.a */; }; - 1D9B977EF02A4A4889A3DB8D /* libz.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 66D0C7202A274329A44896AF /* libz.tbd */; }; - 87AC1C7FBD2D486A8496775D /* libRNDeviceInfo.a in Frameworks */ = {isa = PBXBuildFile; fileRef = DEA1E60B1E4C4CF08017D6C7 /* libRNDeviceInfo.a */; }; - 603338A972BC497CB13A8E7E /* libRNDeviceInfo-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 145DB45C59D944B7BC067032 /* libRNDeviceInfo-tvOS.a */; }; - 34AFC50E88444884839918E1 /* libRNCamera.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 7847EE6DABE74D92BBD93F0A /* libRNCamera.a */; }; + 206CC543489C4F7995B4032A /* libCodePush.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 891CFC0FAA7D49E980C84838 /* libCodePush.a */; }; + C7220E8B42ED4C16A6C2AE14 /* libz.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 03F6F5CC7188401F80052D6D /* libz.tbd */; }; + FEBB7F68D5534228A6A832AD /* libRNDeviceInfo.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 0C488E5D3FD5417DAAAA5C79 /* libRNDeviceInfo.a */; }; + 59D20E8E9CD64A01B87A3AC0 /* libRNDeviceInfo-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 22D705AD40EF415A95C31652 /* libRNDeviceInfo-tvOS.a */; }; + D240C4819F1E4B80BB6D7BEE /* libRNCamera.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 4F8C0E0ED2BA401B9075C9F3 /* libRNCamera.a */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -351,14 +351,14 @@ ADBDB91F1DFEBF0600ED6528 /* RCTBlob.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTBlob.xcodeproj; path = "../node_modules/react-native/Libraries/Blob/RCTBlob.xcodeproj"; sourceTree = ""; }; ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; }; ED2971642150620600B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS12.0.sdk/System/Library/Frameworks/JavaScriptCore.framework; sourceTree = DEVELOPER_DIR; }; - 0CB64B19BE27429888B0F5FA /* CodePush.xcodeproj */ = {isa = PBXFileReference; name = "CodePush.xcodeproj"; path = "../node_modules/react-native-code-push/ios/CodePush.xcodeproj"; sourceTree = ""; fileEncoding = undefined; lastKnownFileType = wrapper.pb-project; explicitFileType = undefined; includeInIndex = 0; }; - 928B0784CE244B05BADC60D9 /* libCodePush.a */ = {isa = PBXFileReference; name = "libCodePush.a"; path = "libCodePush.a"; sourceTree = ""; fileEncoding = undefined; lastKnownFileType = archive.ar; explicitFileType = undefined; includeInIndex = 0; }; - 66D0C7202A274329A44896AF /* libz.tbd */ = {isa = PBXFileReference; name = "libz.tbd"; path = "usr/lib/libz.tbd"; sourceTree = SDKROOT; fileEncoding = undefined; lastKnownFileType = sourcecode.text-based-dylib-definition; explicitFileType = undefined; includeInIndex = 0; }; - D7C737D4F5674419B8D2A7F0 /* RNDeviceInfo.xcodeproj */ = {isa = PBXFileReference; name = "RNDeviceInfo.xcodeproj"; path = "../node_modules/react-native-device-info/ios/RNDeviceInfo.xcodeproj"; sourceTree = ""; fileEncoding = undefined; lastKnownFileType = wrapper.pb-project; explicitFileType = undefined; includeInIndex = 0; }; - DEA1E60B1E4C4CF08017D6C7 /* libRNDeviceInfo.a */ = {isa = PBXFileReference; name = "libRNDeviceInfo.a"; path = "libRNDeviceInfo.a"; sourceTree = ""; fileEncoding = undefined; lastKnownFileType = archive.ar; explicitFileType = undefined; includeInIndex = 0; }; - 145DB45C59D944B7BC067032 /* libRNDeviceInfo-tvOS.a */ = {isa = PBXFileReference; name = "libRNDeviceInfo-tvOS.a"; path = "libRNDeviceInfo-tvOS.a"; sourceTree = ""; fileEncoding = undefined; lastKnownFileType = archive.ar; explicitFileType = undefined; includeInIndex = 0; }; - 00A674D206BA447C9B2B9CBA /* RNCamera.xcodeproj */ = {isa = PBXFileReference; name = "RNCamera.xcodeproj"; path = "../node_modules/react-native-camera/ios/RNCamera.xcodeproj"; sourceTree = ""; fileEncoding = undefined; lastKnownFileType = wrapper.pb-project; explicitFileType = undefined; includeInIndex = 0; }; - 7847EE6DABE74D92BBD93F0A /* libRNCamera.a */ = {isa = PBXFileReference; name = "libRNCamera.a"; path = "libRNCamera.a"; sourceTree = ""; fileEncoding = undefined; lastKnownFileType = archive.ar; explicitFileType = undefined; includeInIndex = 0; }; + D256D2ADE9FF4E9782EBCA6D /* CodePush.xcodeproj */ = {isa = PBXFileReference; name = "CodePush.xcodeproj"; path = "../node_modules/react-native-code-push/ios/CodePush.xcodeproj"; sourceTree = ""; fileEncoding = undefined; lastKnownFileType = wrapper.pb-project; explicitFileType = undefined; includeInIndex = 0; }; + 891CFC0FAA7D49E980C84838 /* libCodePush.a */ = {isa = PBXFileReference; name = "libCodePush.a"; path = "libCodePush.a"; sourceTree = ""; fileEncoding = undefined; lastKnownFileType = archive.ar; explicitFileType = undefined; includeInIndex = 0; }; + 03F6F5CC7188401F80052D6D /* libz.tbd */ = {isa = PBXFileReference; name = "libz.tbd"; path = "usr/lib/libz.tbd"; sourceTree = SDKROOT; fileEncoding = undefined; lastKnownFileType = sourcecode.text-based-dylib-definition; explicitFileType = undefined; includeInIndex = 0; }; + C6058A0BC9054E0394045AC4 /* RNDeviceInfo.xcodeproj */ = {isa = PBXFileReference; name = "RNDeviceInfo.xcodeproj"; path = "../node_modules/react-native-device-info/ios/RNDeviceInfo.xcodeproj"; sourceTree = ""; fileEncoding = undefined; lastKnownFileType = wrapper.pb-project; explicitFileType = undefined; includeInIndex = 0; }; + 0C488E5D3FD5417DAAAA5C79 /* libRNDeviceInfo.a */ = {isa = PBXFileReference; name = "libRNDeviceInfo.a"; path = "libRNDeviceInfo.a"; sourceTree = ""; fileEncoding = undefined; lastKnownFileType = archive.ar; explicitFileType = undefined; includeInIndex = 0; }; + 22D705AD40EF415A95C31652 /* libRNDeviceInfo-tvOS.a */ = {isa = PBXFileReference; name = "libRNDeviceInfo-tvOS.a"; path = "libRNDeviceInfo-tvOS.a"; sourceTree = ""; fileEncoding = undefined; lastKnownFileType = archive.ar; explicitFileType = undefined; includeInIndex = 0; }; + 0F57B32024664223A7D6E682 /* RNCamera.xcodeproj */ = {isa = PBXFileReference; name = "RNCamera.xcodeproj"; path = "../node_modules/react-native-camera/ios/RNCamera.xcodeproj"; sourceTree = ""; fileEncoding = undefined; lastKnownFileType = wrapper.pb-project; explicitFileType = undefined; includeInIndex = 0; }; + 4F8C0E0ED2BA401B9075C9F3 /* libRNCamera.a */ = {isa = PBXFileReference; name = "libRNCamera.a"; path = "libRNCamera.a"; sourceTree = ""; fileEncoding = undefined; lastKnownFileType = archive.ar; explicitFileType = undefined; includeInIndex = 0; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -387,10 +387,10 @@ 832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */, 00C302EA1ABCBA2D00DB3ED1 /* libRCTVibration.a in Frameworks */, 139FDEF61B0652A700C62182 /* libRCTWebSocket.a in Frameworks */, - 84325BCA939E4E4E8090435C /* libCodePush.a in Frameworks */, - 1D9B977EF02A4A4889A3DB8D /* libz.tbd in Frameworks */, - 87AC1C7FBD2D486A8496775D /* libRNDeviceInfo.a in Frameworks */, - 34AFC50E88444884839918E1 /* libRNCamera.a in Frameworks */, + 206CC543489C4F7995B4032A /* libCodePush.a in Frameworks */, + C7220E8B42ED4C16A6C2AE14 /* libz.tbd in Frameworks */, + FEBB7F68D5534228A6A832AD /* libRNDeviceInfo.a in Frameworks */, + D240C4819F1E4B80BB6D7BEE /* libRNCamera.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -407,7 +407,7 @@ 2D02E4C61E0B4AEC006451C7 /* libRCTSettings-tvOS.a in Frameworks */, 2D02E4C71E0B4AEC006451C7 /* libRCTText-tvOS.a in Frameworks */, 2D02E4C81E0B4AEC006451C7 /* libRCTWebSocket-tvOS.a in Frameworks */, - 603338A972BC497CB13A8E7E /* libRNDeviceInfo-tvOS.a in Frameworks */, + 59D20E8E9CD64A01B87A3AC0 /* libRNDeviceInfo-tvOS.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -544,7 +544,7 @@ ED297162215061F000B7C4FE /* JavaScriptCore.framework */, ED2971642150620600B7C4FE /* JavaScriptCore.framework */, 2D16E6891FA4F8E400B85C8A /* libReact.a */, - 66D0C7202A274329A44896AF /* libz.tbd */, + 03F6F5CC7188401F80052D6D /* libz.tbd */, ); name = Frameworks; sourceTree = ""; @@ -582,9 +582,9 @@ 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */, 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */, 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */, - 0CB64B19BE27429888B0F5FA /* CodePush.xcodeproj */, - D7C737D4F5674419B8D2A7F0 /* RNDeviceInfo.xcodeproj */, - 00A674D206BA447C9B2B9CBA /* RNCamera.xcodeproj */, + D256D2ADE9FF4E9782EBCA6D /* CodePush.xcodeproj */, + C6058A0BC9054E0394045AC4 /* RNDeviceInfo.xcodeproj */, + 0F57B32024664223A7D6E682 /* RNCamera.xcodeproj */, ); name = Libraries; sourceTree = ""; @@ -1213,9 +1213,6 @@ LIBRARY_SEARCH_PATHS = ( "$(inherited)", "\"$(SRCROOT)/$(TARGET_NAME)\"", - "\"$(SRCROOT)/$(TARGET_NAME)\"", - "\"$(SRCROOT)/$(TARGET_NAME)\"", - "\"$(SRCROOT)/$(TARGET_NAME)\"", ); HEADER_SEARCH_PATHS = ( "$(inherited)", @@ -1244,9 +1241,6 @@ LIBRARY_SEARCH_PATHS = ( "$(inherited)", "\"$(SRCROOT)/$(TARGET_NAME)\"", - "\"$(SRCROOT)/$(TARGET_NAME)\"", - "\"$(SRCROOT)/$(TARGET_NAME)\"", - "\"$(SRCROOT)/$(TARGET_NAME)\"", ); HEADER_SEARCH_PATHS = ( "$(inherited)", @@ -1332,9 +1326,6 @@ LIBRARY_SEARCH_PATHS = ( "$(inherited)", "\"$(SRCROOT)/$(TARGET_NAME)\"", - "\"$(SRCROOT)/$(TARGET_NAME)\"", - "\"$(SRCROOT)/$(TARGET_NAME)\"", - "\"$(SRCROOT)/$(TARGET_NAME)\"", ); HEADER_SEARCH_PATHS = ( "$(inherited)", @@ -1371,9 +1362,6 @@ LIBRARY_SEARCH_PATHS = ( "$(inherited)", "\"$(SRCROOT)/$(TARGET_NAME)\"", - "\"$(SRCROOT)/$(TARGET_NAME)\"", - "\"$(SRCROOT)/$(TARGET_NAME)\"", - "\"$(SRCROOT)/$(TARGET_NAME)\"", ); HEADER_SEARCH_PATHS = ( "$(inherited)", @@ -1409,9 +1397,6 @@ LIBRARY_SEARCH_PATHS = ( "$(inherited)", "\"$(SRCROOT)/$(TARGET_NAME)\"", - "\"$(SRCROOT)/$(TARGET_NAME)\"", - "\"$(SRCROOT)/$(TARGET_NAME)\"", - "\"$(SRCROOT)/$(TARGET_NAME)\"", ); HEADER_SEARCH_PATHS = ( "$(inherited)", @@ -1447,9 +1432,6 @@ LIBRARY_SEARCH_PATHS = ( "$(inherited)", "\"$(SRCROOT)/$(TARGET_NAME)\"", - "\"$(SRCROOT)/$(TARGET_NAME)\"", - "\"$(SRCROOT)/$(TARGET_NAME)\"", - "\"$(SRCROOT)/$(TARGET_NAME)\"", ); HEADER_SEARCH_PATHS = ( "$(inherited)", diff --git a/ios/screenAd/AppDelegate.h b/ios/screenAd/AppDelegate.h index 4b5644f..2726d5e 100644 --- a/ios/screenAd/AppDelegate.h +++ b/ios/screenAd/AppDelegate.h @@ -5,9 +5,10 @@ * LICENSE file in the root directory of this source tree. */ +#import #import -@interface AppDelegate : UIResponder +@interface AppDelegate : UIResponder @property (nonatomic, strong) UIWindow *window; diff --git a/ios/screenAd/AppDelegate.m b/ios/screenAd/AppDelegate.m index 09dd71a..f2968f2 100644 --- a/ios/screenAd/AppDelegate.m +++ b/ios/screenAd/AppDelegate.m @@ -8,6 +8,7 @@ #import "AppDelegate.h" #import +#import #import #import @@ -15,20 +16,12 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { - NSURL *jsCodeLocation; + RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions]; + RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge + moduleName:@"screenAd" + initialProperties:nil]; - - #ifdef DEBUG - jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil]; - #else - jsCodeLocation = [CodePush bundleURL]; - #endif - - RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation - moduleName:@"screenAd" - initialProperties:nil - launchOptions:launchOptions]; - rootView.backgroundColor = [UIColor blackColor]; + 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]; @@ -38,4 +31,13 @@ return YES; } +- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge +{ +#if DEBUG + return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil]; +#else + return [CodePush bundleURL]; +#endif +} + @end diff --git a/metro.config.js b/metro.config.js new file mode 100644 index 0000000..13a9642 --- /dev/null +++ b/metro.config.js @@ -0,0 +1,17 @@ +/** + * Metro configuration for React Native + * https://github.com/facebook/react-native + * + * @format + */ + +module.exports = { + transformer: { + getTransformOptions: async () => ({ + transform: { + experimentalImportSupport: false, + inlineRequires: false, + }, + }), + }, +}; diff --git a/package.json b/package.json index 822b8bc..7866644 100644 --- a/package.json +++ b/package.json @@ -7,20 +7,21 @@ "test": "jest" }, "dependencies": { - "react": "16.8.6", - "react-native": "0.59.8", - "react-native-animatable": "^1.3.1", + "react": "16.8.3", + "react-native": "0.59.9", + "react-native-animatable": "^1.3.2", "react-native-camera": "^1.12.0", - "react-native-code-push": "^5.5.2", - "react-native-device-info": "^0.26.4", + "react-native-code-push": "^5.6.0", + "react-native-device-info": "^2.1.2", "react-native-swiper": "^1.5.14" }, "devDependencies": { - "babel-core": "7.0.0-bridge.0", - "babel-jest": "24.1.0", - "jest": "24.1.0", - "metro-react-native-babel-preset": "0.51.1", - "react-test-renderer": "16.6.3" + "@babel/core": "^7.4.5", + "@babel/runtime": "^7.4.5", + "babel-jest": "^24.8.0", + "jest": "^24.8.0", + "metro-react-native-babel-preset": "^0.54.1", + "react-test-renderer": "16.8.3" }, "jest": { "preset": "react-native"