diff --git a/.gitignore b/.gitignore index f5ada1eab332e..9cb7ea721d294 100644 --- a/.gitignore +++ b/.gitignore @@ -74,6 +74,7 @@ jarjar-rules.txt /android/expoview/src/main/java/host/exp/exponent/generated/ExponentKeys.java /android/app/fabric.properties /apps/bare-expo/android/app/google-services.json +/apps/bare-expo/ios/BareExpo/GoogleService-Info.plist /ios/Exponent/Generated/EXKeys.h /ios/ExponentIntegrationTests/EXTestEnvironment.plist /exponent-view-template/ios/Podfile diff --git a/apps/bare-expo/ios/BareExpo.xcodeproj/project.pbxproj b/apps/bare-expo/ios/BareExpo.xcodeproj/project.pbxproj index 964a23b768f10..97a5b44931dff 100644 --- a/apps/bare-expo/ios/BareExpo.xcodeproj/project.pbxproj +++ b/apps/bare-expo/ios/BareExpo.xcodeproj/project.pbxproj @@ -187,10 +187,12 @@ buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "BareExpo" */; buildPhases = ( 4B0225741A3EE6614741CF8A /* [CP] Check Pods Manifest.lock */, + 2168BD7723E476FA00A94C0D /* Generate Dynamic Macros */, FD4C38642228810C00325AF5 /* Start Packager */, 13B07F871A680F5B00A75B9A /* Sources */, 13B07F8C1A680F5B00A75B9A /* Frameworks */, 13B07F8E1A680F5B00A75B9A /* Resources */, + 2168B70623E338A300A94C0D /* Copy Bundle Resources Conditionally */, 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */, F6332E868606A56C9C6C2366 /* [CP] Copy Pods Resources */, ); @@ -273,7 +275,43 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "export NODE_BINARY=node\n../node_modules/react-native/scripts/react-native-xcode.sh"; + shellScript = "export NODE_BINARY=node\n../node_modules/react-native/scripts/react-native-xcode.sh\n"; + }; + 2168B70623E338A300A94C0D /* Copy Bundle Resources Conditionally */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + ); + name = "Copy Bundle Resources Conditionally"; + outputFileListPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/bash; + shellScript = "$SRCROOT/Build-Phases/cp-bundle-resources-conditionally.sh\n"; + }; + 2168BD7723E476FA00A94C0D /* Generate Dynamic Macros */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + ); + name = "Generate Dynamic Macros"; + outputFileListPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/bash; + shellScript = "$SRCROOT/Build-Phases/generate-dynamic-macros.sh\n"; }; 4B0225741A3EE6614741CF8A /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; diff --git a/apps/bare-expo/ios/Build-Phases/cp-bundle-resources-conditionally.sh b/apps/bare-expo/ios/Build-Phases/cp-bundle-resources-conditionally.sh new file mode 100755 index 0000000000000..c47b877371fe8 --- /dev/null +++ b/apps/bare-expo/ios/Build-Phases/cp-bundle-resources-conditionally.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env bash + +set -exo pipefail + +SRC_FILE="${PROJECT_DIR}/BareExpo/GoogleService-Info.plist" +DST_FILE="${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.app/GoogleService-Info.plist" +if [ -f $SRC_FILE ]; then + if [[ $(grep -L "NO_CLIENT_ID" "$SRC_FILE") ]]; then + cp -r "$SRC_FILE" "$DST_FILE" + fi +fi diff --git a/apps/bare-expo/ios/Build-Phases/generate-dynamic-macros.sh b/apps/bare-expo/ios/Build-Phases/generate-dynamic-macros.sh new file mode 100755 index 0000000000000..57878b72734f7 --- /dev/null +++ b/apps/bare-expo/ios/Build-Phases/generate-dynamic-macros.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env bash + +set -exo pipefail + +if [ -z "$EXPO_TOOLS_DIR" ]; then + EXPO_TOOLS_DIR="${SRCROOT}/../../../tools" +fi + +source ${EXPO_TOOLS_DIR}/source-login-scripts.sh +export PATH="${SRCROOT}/../../../bin:$PATH" + +et ios-generate-dynamic-macros --configuration ${CONFIGURATION} diff --git a/secrets/keys.json b/secrets/keys.json index a6aa87e880436..6d70a6e6a7f55 100644 Binary files a/secrets/keys.json and b/secrets/keys.json differ diff --git a/template-files/android/bare-expo/android/app/google-services.json b/template-files/android/bare-expo/android/app/google-services.json index a63b1dcb63d02..a96407033626c 100644 --- a/template-files/android/bare-expo/android/app/google-services.json +++ b/template-files/android/bare-expo/android/app/google-services.json @@ -8,15 +8,15 @@ "client": [ { "client_info": { - "mobilesdk_app_id": "${BARE_EXPO_FIREBASE_GOOGLE_APP_ID}", + "mobilesdk_app_id": "${BARE_EXPO_FIREBASE_ANDROID_GOOGLE_APP_ID}", "android_client_info": { - "package_name": "${BARE_EXPO_FIREBASE_BUNDLE_ID}" + "package_name": "${BARE_EXPO_FIREBASE_ANDROID_BUNDLE_ID}" } }, "oauth_client": [], "api_key": [ { - "current_key": "${BARE_EXPO_FIREBASE_ANDROID_KEY}" + "current_key": "${BARE_EXPO_FIREBASE_ANDROID_API_KEY}" } ], "services": {} diff --git a/template-files/ios-paths.json b/template-files/ios-paths.json index 0b1b2b12daa80..86caa53574d6c 100644 --- a/template-files/ios-paths.json +++ b/template-files/ios-paths.json @@ -1,3 +1,4 @@ { - "GoogleService-Info.plist": "ios/Exponent/Supporting/" + "GoogleService-Info.plist": "ios/Exponent/Supporting/", + "bare-expo/ios/BareExpo/GoogleService-Info.plist": "apps/" } diff --git a/template-files/ios/bare-expo/ios/BareExpo/GoogleService-Info.plist b/template-files/ios/bare-expo/ios/BareExpo/GoogleService-Info.plist new file mode 100644 index 0000000000000..604b806d949c3 --- /dev/null +++ b/template-files/ios/bare-expo/ios/BareExpo/GoogleService-Info.plist @@ -0,0 +1,36 @@ + + + + + CLIENT_ID + ${BARE_EXPO_FIREBASE_IOS_CLIENT_ID} + REVERSED_CLIENT_ID + ${BARE_EXPO_FIREBASE_IOS_REVERSED_CLIENT_ID} + API_KEY + ${BARE_EXPO_FIREBASE_IOS_API_KEY} + GCM_SENDER_ID + ${BARE_EXPO_FIREBASE_GCM_SENDER_ID} + PLIST_VERSION + 1 + BUNDLE_ID + ${BARE_EXPO_FIREBASE_IOS_BUNDLE_ID} + PROJECT_ID + ${BARE_EXPO_FIREBASE_PROJECT_ID} + STORAGE_BUCKET + ${BARE_EXPO_FIREBASE_STORAGE_BUCKET} + IS_ADS_ENABLED + + IS_ANALYTICS_ENABLED + + IS_APPINVITE_ENABLED + + IS_GCM_ENABLED + + IS_SIGNIN_ENABLED + + GOOGLE_APP_ID + ${BARE_EXPO_FIREBASE_IOS_GOOGLE_APP_ID} + FIREBASE_DATABASE_URL + ${BARE_EXPO_FIREBASE_DATABASE_URL} + + diff --git a/template-files/keys.json b/template-files/keys.json index 09272f0d413b3..251f72fb216c9 100644 --- a/template-files/keys.json +++ b/template-files/keys.json @@ -25,7 +25,16 @@ "FIREBASE_STORAGE_BUCKET": "", "FIREBASE_GOOGLE_APP_ID": "", "FIREBASE_DATABASE_URL": "", - "BARE_EXPO_FIREBASE_GOOGLE_APP_ID": "1:300000000000:android:0000000000000000", - "BARE_EXPO_FIREBASE_BUNDLE_ID": "dev.expo.payments", - "BARE_EXPO_FIREBASE_ANDROID_KEY": "" + "BARE_EXPO_FIREBASE_DATABASE_URL": "", + "BARE_EXPO_FIREBASE_STORAGE_BUCKET": "", + "BARE_EXPO_FIREBASE_PROJECT_ID": "", + "BARE_EXPO_FIREBASE_GCM_SENDER_ID": "", + "BARE_EXPO_FIREBASE_ANDROID_BUNDLE_ID": "dev.expo.payments", + "BARE_EXPO_FIREBASE_ANDROID_GOOGLE_APP_ID": "1:300000000000:android:0000000000000000", + "BARE_EXPO_FIREBASE_ANDROID_API_KEY": "", + "BARE_EXPO_FIREBASE_IOS_BUNDLE_ID": "dev.expo.Payments", + "BARE_EXPO_FIREBASE_IOS_CLIENT_ID": "NO_CLIENT_ID", + "BARE_EXPO_FIREBASE_IOS_REVERSED_CLIENT_ID": "", + "BARE_EXPO_FIREBASE_IOS_API_KEY": "", + "BARE_EXPO_FIREBASE_IOS_GOOGLE_APP_ID": "" }