From 660fc9a77657140558c31e39c0826ca83d8ec535 Mon Sep 17 00:00:00 2001 From: Libin Lu Date: Mon, 5 Mar 2018 10:50:00 -0500 Subject: [PATCH] update example with react-native-map --- .../android/app/build.gradle | 4 +- .../quickstart/fcm/MainApplication.java | 2 + .../simple-fcm-client/android/settings.gradle | 2 + .../SimpleFcmClient.xcodeproj/project.pbxproj | 12 +++++- Examples/simple-fcm-client/package.json | 3 +- Examples/simple-fcm-client/yarn.lock | 38 +++++++++++++++++-- 6 files changed, 54 insertions(+), 7 deletions(-) diff --git a/Examples/simple-fcm-client/android/app/build.gradle b/Examples/simple-fcm-client/android/app/build.gradle index 87c9dc5..be26c3b 100644 --- a/Examples/simple-fcm-client/android/app/build.gradle +++ b/Examples/simple-fcm-client/android/app/build.gradle @@ -127,9 +127,11 @@ android { } dependencies { + compile(project(':react-native-maps')) { + exclude group: 'com.google.android.gms', module: 'play-services-base' + } compile project(':react-native-fcm') 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/Examples/simple-fcm-client/android/app/src/main/java/com/google/firebase/quickstart/fcm/MainApplication.java b/Examples/simple-fcm-client/android/app/src/main/java/com/google/firebase/quickstart/fcm/MainApplication.java index 91ebcf1..d8b832e 100644 --- a/Examples/simple-fcm-client/android/app/src/main/java/com/google/firebase/quickstart/fcm/MainApplication.java +++ b/Examples/simple-fcm-client/android/app/src/main/java/com/google/firebase/quickstart/fcm/MainApplication.java @@ -4,6 +4,7 @@ import android.app.Application; import android.util.Log; import com.facebook.react.ReactApplication; +import com.airbnb.android.react.maps.MapsPackage; import com.evollu.react.fcm.FIRMessagingPackage; import com.facebook.react.ReactInstanceManager; import com.facebook.react.ReactNativeHost; @@ -25,6 +26,7 @@ public class MainApplication extends Application implements ReactApplication { protected List getPackages() { return Arrays.asList( new MainReactPackage(), + new MapsPackage(), new FIRMessagingPackage() ); } diff --git a/Examples/simple-fcm-client/android/settings.gradle b/Examples/simple-fcm-client/android/settings.gradle index d75953b..a8ad2f3 100644 --- a/Examples/simple-fcm-client/android/settings.gradle +++ b/Examples/simple-fcm-client/android/settings.gradle @@ -1,4 +1,6 @@ rootProject.name = 'SimpleFcmClient' +include ':react-native-maps' +project(':react-native-maps').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-maps/lib/android') include ':app' include ':react-native-fcm' diff --git a/Examples/simple-fcm-client/ios/SimpleFcmClient.xcodeproj/project.pbxproj b/Examples/simple-fcm-client/ios/SimpleFcmClient.xcodeproj/project.pbxproj index 4065653..5f772c8 100644 --- a/Examples/simple-fcm-client/ios/SimpleFcmClient.xcodeproj/project.pbxproj +++ b/Examples/simple-fcm-client/ios/SimpleFcmClient.xcodeproj/project.pbxproj @@ -5,7 +5,6 @@ }; objectVersion = 46; objects = { - /* Begin PBXBuildFile section */ 00C302E51ABCBA2D00DB3ED1 /* libRCTActionSheet.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */; }; 00C302E71ABCBA2D00DB3ED1 /* libRCTGeolocation.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */; }; @@ -30,6 +29,7 @@ 6976C617E52062E3EE272128 /* libPods-SimpleFcmClient.a in Frameworks */ = {isa = PBXBuildFile; fileRef = A959965489E40CE19F2B06B4 /* libPods-SimpleFcmClient.a */; }; 832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 832341B51AAA6A8300B99B32 /* libRCTText.a */; }; FAE94A218EB64E38BF8D8E9B /* libRNFIRMessaging.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 692E216422234A4CB6A7A838 /* libRNFIRMessaging.a */; }; + B5EEA6C40DAD43C696D4A7EE /* libAirMaps.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 441E689027CF4924A5FEA8F6 /* libAirMaps.a */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -289,6 +289,8 @@ A959965489E40CE19F2B06B4 /* libPods-SimpleFcmClient.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-SimpleFcmClient.a"; sourceTree = BUILT_PRODUCTS_DIR; }; C7DEB70C413E484CBFA6AC45 /* RNFIRMessaging.xcodeproj */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = "wrapper.pb-project"; name = RNFIRMessaging.xcodeproj; path = "../node_modules/react-native-fcm/ios/RNFIRMessaging.xcodeproj"; sourceTree = ""; }; CF6939675D5A4A68FBE567C0 /* Pods-SimpleFcmClient.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SimpleFcmClient.release.xcconfig"; path = "Pods/Target Support Files/Pods-SimpleFcmClient/Pods-SimpleFcmClient.release.xcconfig"; sourceTree = ""; }; + 955F937AAFAB473EA79C80F7 /* AirMaps.xcodeproj */ = {isa = PBXFileReference; name = "AirMaps.xcodeproj"; path = "../node_modules/react-native-maps/lib/ios/AirMaps.xcodeproj"; sourceTree = ""; fileEncoding = undefined; lastKnownFileType = wrapper.pb-project; explicitFileType = undefined; includeInIndex = 0; }; + 441E689027CF4924A5FEA8F6 /* libAirMaps.a */ = {isa = PBXFileReference; name = "libAirMaps.a"; path = "libAirMaps.a"; sourceTree = ""; fileEncoding = undefined; lastKnownFileType = archive.ar; explicitFileType = undefined; includeInIndex = 0; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -319,6 +321,7 @@ 139FDEF61B0652A700C62182 /* libRCTWebSocket.a in Frameworks */, FAE94A218EB64E38BF8D8E9B /* libRNFIRMessaging.a in Frameworks */, 6976C617E52062E3EE272128 /* libPods-SimpleFcmClient.a in Frameworks */, + B5EEA6C40DAD43C696D4A7EE /* libAirMaps.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -510,6 +513,7 @@ 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */, 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */, C7DEB70C413E484CBFA6AC45 /* RNFIRMessaging.xcodeproj */, + 955F937AAFAB473EA79C80F7 /* AirMaps.xcodeproj */, ); name = Libraries; sourceTree = ""; @@ -598,7 +602,7 @@ 83CBB9F71A601CBA00E9B192 /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0800; + LastUpgradeCheck = 800; ORGANIZATIONNAME = Facebook; TargetAttributes = { 00E356ED1AD99517003FC87E = { @@ -1093,6 +1097,7 @@ LIBRARY_SEARCH_PATHS = ( "$(inherited)", "\"$(SRCROOT)/$(TARGET_NAME)\"", + "\"$(SRCROOT)/$(TARGET_NAME)\"", ); PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -1113,6 +1118,7 @@ LIBRARY_SEARCH_PATHS = ( "$(inherited)", "\"$(SRCROOT)/$(TARGET_NAME)\"", + "\"$(SRCROOT)/$(TARGET_NAME)\"", ); PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -1140,6 +1146,7 @@ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, "$(SRCROOT)/../node_modules/react-native/React/**", "$(SRCROOT)/../node_modules/react-native-fcm/ios", + "$(SRCROOT)/../node_modules/react-native-maps/lib/ios/**", ); INFOPLIST_FILE = SimpleFcmClient/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; @@ -1174,6 +1181,7 @@ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, "$(SRCROOT)/../node_modules/react-native/React/**", "$(SRCROOT)/../node_modules/react-native-fcm/ios", + "$(SRCROOT)/../node_modules/react-native-maps/lib/ios/**", ); INFOPLIST_FILE = SimpleFcmClient/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; diff --git a/Examples/simple-fcm-client/package.json b/Examples/simple-fcm-client/package.json index 233b9a3..d96dc56 100644 --- a/Examples/simple-fcm-client/package.json +++ b/Examples/simple-fcm-client/package.json @@ -9,7 +9,8 @@ "dependencies": { "react": "16.0.0-alpha.12", "react-native": "^0.47.2", - "react-native-fcm": "^14.0.0", + "react-native-fcm": "^14.0.1", + "react-native-maps": "^0.20.1", "react-navigation": "^1.2.1" }, "jest": { diff --git a/Examples/simple-fcm-client/yarn.lock b/Examples/simple-fcm-client/yarn.lock index 360977f..09c90d5 100644 --- a/Examples/simple-fcm-client/yarn.lock +++ b/Examples/simple-fcm-client/yarn.lock @@ -492,6 +492,14 @@ babel-plugin-jest-hoist@^16.0.0: version "16.0.0" resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-16.0.0.tgz#b58ca3f770982a7e7c25b5614b2e57e9dafc6e76" +babel-plugin-module-resolver@^2.3.0: + version "2.7.1" + resolved "https://registry.yarnpkg.com/babel-plugin-module-resolver/-/babel-plugin-module-resolver-2.7.1.tgz#18be3c42ddf59f7a456c9e0512cd91394f6e4be1" + dependencies: + find-babel-config "^1.0.1" + glob "^7.1.1" + resolve "^1.2.0" + babel-plugin-react-transform@2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/babel-plugin-react-transform/-/babel-plugin-react-transform-2.0.2.tgz#515bbfa996893981142d90b1f9b1635de2995109" @@ -1921,6 +1929,13 @@ finalhandler@0.4.0: on-finished "~2.3.0" unpipe "~1.0.0" +find-babel-config@^1.0.1: + version "1.1.0" + resolved "https://registry.yarnpkg.com/find-babel-config/-/find-babel-config-1.1.0.tgz#acc01043a6749fec34429be6b64f542ebb5d6355" + dependencies: + json5 "^0.5.1" + path-exists "^3.0.0" + find-up@^1.0.0, find-up@^1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/find-up/-/find-up-1.1.2.tgz#6b2e9822b1a2ce0a60ab64d610eccad53cb24d0f" @@ -3514,6 +3529,10 @@ path-exists@^2.0.0: dependencies: pinkie-promise "^2.0.0" +path-exists@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515" + path-is-absolute@^1.0.0, path-is-absolute@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" @@ -3731,9 +3750,16 @@ react-native-drawer-layout@1.3.2: dependencies: react-native-dismiss-keyboard "1.0.0" -react-native-fcm@^14.0.0: - version "14.0.0" - resolved "https://registry.yarnpkg.com/react-native-fcm/-/react-native-fcm-14.0.0.tgz#8c35d76b8867d9dc70ac3aa15fff6685f4f40063" +react-native-fcm@^14.0.1: + version "14.0.1" + resolved "https://registry.yarnpkg.com/react-native-fcm/-/react-native-fcm-14.0.1.tgz#833e6a38a1b2fd1a9b7b69be35e007f7361fe474" + +react-native-maps@^0.20.1: + version "0.20.1" + resolved "https://registry.yarnpkg.com/react-native-maps/-/react-native-maps-0.20.1.tgz#b5247a9a26446b2e1ffc3f680db8ba6ccc960096" + dependencies: + babel-plugin-module-resolver "^2.3.0" + babel-preset-react-native "1.9.0" react-native-safe-area-view@^0.7.0: version "0.7.0" @@ -4071,6 +4097,12 @@ resolve@^1.1.6: version "1.2.0" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.2.0.tgz#9589c3f2f6149d1417a40becc1663db6ec6bc26c" +resolve@^1.2.0: + version "1.5.0" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.5.0.tgz#1f09acce796c9a762579f31b2c1cc4c3cddf9f36" + dependencies: + path-parse "^1.0.5" + response-time@~2.3.1: version "2.3.2" resolved "https://registry.yarnpkg.com/response-time/-/response-time-2.3.2.tgz#ffa71bab952d62f7c1d49b7434355fbc68dffc5a" -- 2.26.2