From c69ad1b4beeff3b5acfbba60616676e36f91a97a Mon Sep 17 00:00:00 2001 From: hupeng Date: Fri, 1 Mar 2019 10:24:44 +0800 Subject: [PATCH] =?UTF-8?q?[=E7=B3=BB=E7=BB=9F][=E6=96=B0=E5=A2=9E]:?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E8=AE=BE=E5=A4=87=E4=BF=A1=E6=81=AF=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- android/app/build.gradle | 1 + .../java/com/screenad/MainApplication.java | 2 ++ android/settings.gradle | 2 ++ ios/screenAd.xcodeproj/project.pbxproj | 28 +++++++++++++++++++ package.json | 1 + 5 files changed, 34 insertions(+) diff --git a/android/app/build.gradle b/android/app/build.gradle index 12293d1..cdd1048 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -158,6 +158,7 @@ android { } dependencies { + implementation project(':react-native-device-info') implementation project(':react-native-code-push') implementation fileTree(dir: "libs", include: ["*.jar"]) implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}" diff --git a/android/app/src/main/java/com/screenad/MainApplication.java b/android/app/src/main/java/com/screenad/MainApplication.java index 2253e13..b89b1f2 100644 --- a/android/app/src/main/java/com/screenad/MainApplication.java +++ b/android/app/src/main/java/com/screenad/MainApplication.java @@ -3,6 +3,7 @@ package com.screenad; import android.app.Application; import com.facebook.react.ReactApplication; +import com.learnium.RNDeviceInfo.RNDeviceInfo; import com.microsoft.codepush.react.CodePush; import com.facebook.react.ReactNativeHost; import com.facebook.react.ReactPackage; @@ -30,6 +31,7 @@ public class MainApplication extends Application implements ReactApplication { protected List getPackages() { return Arrays.asList( new MainReactPackage(), + new RNDeviceInfo(), new CodePush( BuildConfig.CODEPUSH_KEY, getApplicationContext(), diff --git a/android/settings.gradle b/android/settings.gradle index ec77d91..c547ae8 100644 --- a/android/settings.gradle +++ b/android/settings.gradle @@ -1,4 +1,6 @@ rootProject.name = 'screenAd' +include ':react-native-device-info' +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') diff --git a/ios/screenAd.xcodeproj/project.pbxproj b/ios/screenAd.xcodeproj/project.pbxproj index c2764c9..8f0c423 100644 --- a/ios/screenAd.xcodeproj/project.pbxproj +++ b/ios/screenAd.xcodeproj/project.pbxproj @@ -41,6 +41,8 @@ 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 */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -351,6 +353,9 @@ 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; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -381,6 +386,7 @@ 139FDEF61B0652A700C62182 /* libRCTWebSocket.a in Frameworks */, 84325BCA939E4E4E8090435C /* libCodePush.a in Frameworks */, 1D9B977EF02A4A4889A3DB8D /* libz.tbd in Frameworks */, + 87AC1C7FBD2D486A8496775D /* libRNDeviceInfo.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -397,6 +403,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 */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -572,6 +579,7 @@ 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */, 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */, 0CB64B19BE27429888B0F5FA /* CodePush.xcodeproj */, + D7C737D4F5674419B8D2A7F0 /* RNDeviceInfo.xcodeproj */, ); name = Libraries; sourceTree = ""; @@ -1200,10 +1208,13 @@ LIBRARY_SEARCH_PATHS = ( "$(inherited)", "\"$(SRCROOT)/$(TARGET_NAME)\"", + "\"$(SRCROOT)/$(TARGET_NAME)\"", + "\"$(SRCROOT)/$(TARGET_NAME)\"", ); HEADER_SEARCH_PATHS = ( "$(inherited)", "$(SRCROOT)\..\node_modules\react-native-code-push\ios\CodePush/**", + "$(SRCROOT)\..\node_modules\react-native-device-info\ios\RNDeviceInfo", ); }; name = Debug; @@ -1226,10 +1237,13 @@ LIBRARY_SEARCH_PATHS = ( "$(inherited)", "\"$(SRCROOT)/$(TARGET_NAME)\"", + "\"$(SRCROOT)/$(TARGET_NAME)\"", + "\"$(SRCROOT)/$(TARGET_NAME)\"", ); HEADER_SEARCH_PATHS = ( "$(inherited)", "$(SRCROOT)\..\node_modules\react-native-code-push\ios\CodePush/**", + "$(SRCROOT)\..\node_modules\react-native-device-info\ios\RNDeviceInfo", ); }; name = Release; @@ -1253,6 +1267,7 @@ HEADER_SEARCH_PATHS = ( "$(inherited)", "$(SRCROOT)\..\node_modules\react-native-code-push\ios\CodePush/**", + "$(SRCROOT)\..\node_modules\react-native-device-info\ios\RNDeviceInfo", ); }; name = Debug; @@ -1275,6 +1290,7 @@ HEADER_SEARCH_PATHS = ( "$(inherited)", "$(SRCROOT)\..\node_modules\react-native-code-push\ios\CodePush/**", + "$(SRCROOT)\..\node_modules\react-native-device-info\ios\RNDeviceInfo", ); }; name = Release; @@ -1305,10 +1321,13 @@ LIBRARY_SEARCH_PATHS = ( "$(inherited)", "\"$(SRCROOT)/$(TARGET_NAME)\"", + "\"$(SRCROOT)/$(TARGET_NAME)\"", + "\"$(SRCROOT)/$(TARGET_NAME)\"", ); HEADER_SEARCH_PATHS = ( "$(inherited)", "$(SRCROOT)\..\node_modules\react-native-code-push\ios\CodePush/**", + "$(SRCROOT)\..\node_modules\react-native-device-info\ios\RNDeviceInfo", ); }; name = Debug; @@ -1339,10 +1358,13 @@ LIBRARY_SEARCH_PATHS = ( "$(inherited)", "\"$(SRCROOT)/$(TARGET_NAME)\"", + "\"$(SRCROOT)/$(TARGET_NAME)\"", + "\"$(SRCROOT)/$(TARGET_NAME)\"", ); HEADER_SEARCH_PATHS = ( "$(inherited)", "$(SRCROOT)\..\node_modules\react-native-code-push\ios\CodePush/**", + "$(SRCROOT)\..\node_modules\react-native-device-info\ios\RNDeviceInfo", ); }; name = Release; @@ -1372,10 +1394,13 @@ LIBRARY_SEARCH_PATHS = ( "$(inherited)", "\"$(SRCROOT)/$(TARGET_NAME)\"", + "\"$(SRCROOT)/$(TARGET_NAME)\"", + "\"$(SRCROOT)/$(TARGET_NAME)\"", ); HEADER_SEARCH_PATHS = ( "$(inherited)", "$(SRCROOT)\..\node_modules\react-native-code-push\ios\CodePush/**", + "$(SRCROOT)\..\node_modules\react-native-device-info\ios\RNDeviceInfo", ); }; name = Debug; @@ -1405,10 +1430,13 @@ LIBRARY_SEARCH_PATHS = ( "$(inherited)", "\"$(SRCROOT)/$(TARGET_NAME)\"", + "\"$(SRCROOT)/$(TARGET_NAME)\"", + "\"$(SRCROOT)/$(TARGET_NAME)\"", ); HEADER_SEARCH_PATHS = ( "$(inherited)", "$(SRCROOT)\..\node_modules\react-native-code-push\ios\CodePush/**", + "$(SRCROOT)\..\node_modules\react-native-device-info\ios\RNDeviceInfo", ); }; name = Release; diff --git a/package.json b/package.json index 6b80a89..34f9c7a 100644 --- a/package.json +++ b/package.json @@ -10,6 +10,7 @@ "react": "16.6.3", "react-native": "0.58.4", "react-native-code-push": "^5.5.2", + "react-native-device-info": "^0.26.4", "react-native-swiper": "^1.5.14" }, "devDependencies": {