From bc5ebcba66f4c512e342842a86315bcd5b5912d7 Mon Sep 17 00:00:00 2001 From: Curtis David Date: Wed, 16 Oct 2024 15:47:48 -0400 Subject: [PATCH 01/15] Remove old google files --- bitrise.yml | 6 +++++- ios/GoogleService-Info.plist | 26 -------------------------- scripts/build.sh | 2 +- 3 files changed, 6 insertions(+), 28 deletions(-) delete mode 100644 ios/GoogleService-Info.plist diff --git a/bitrise.yml b/bitrise.yml index 40c4e621f3b..1fc61f98351 100644 --- a/bitrise.yml +++ b/bitrise.yml @@ -811,7 +811,7 @@ workflows: inputs: - content: |- #!/usr/bin/env bash - yarn test:api-specs + yarn test:api-specs --retries 1 - script@1: is_always_run: true is_skippable: false @@ -1263,6 +1263,8 @@ workflows: inputs: - ipa_path: $BITRISE_APP_STORE_IPA_PATH build_ios_release: + envs: + - NO_FLIPPER: '1' before_run: - code_setup after_run: @@ -1302,6 +1304,8 @@ workflows: - deploy_path: sourcemaps/ios/index.js.map title: Deploy Source Map build_ios_qa: + envs: + - NO_FLIPPER: '1' before_run: - code_setup after_run: diff --git a/ios/GoogleService-Info.plist b/ios/GoogleService-Info.plist deleted file mode 100644 index 8410def31e2..00000000000 --- a/ios/GoogleService-Info.plist +++ /dev/null @@ -1,26 +0,0 @@ - - - - - API_KEY - $(FCM_CONFIG_API_KEY) - GCM_SENDER_ID - $(FCM_CONFIG_MESSAGING_SENDER_ID) - PLIST_VERSION - 1 - BUNDLE_ID - $(PRODUCT_BUNDLE_IDENTIFIER) - PROJECT_ID - $(FCM_CONFIG_PROJECT_ID) - STORAGE_BUCKET - $(FCM_CONFIG_STORAGE_BUCKET) - IS_APPINVITE_ENABLED - - IS_GCM_ENABLED - - IS_SIGNIN_ENABLED - - GOOGLE_APP_ID - $(FCM_CONFIG_APP_ID) - - diff --git a/scripts/build.sh b/scripts/build.sh index 1623dc30ca1..1a8fae27194 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -626,4 +626,4 @@ else else envFileMissing $ANDROID_ENV_FILE fi -fi +fi \ No newline at end of file From 168b1db143aee4fab4321bad9605633cbfe9dc0d Mon Sep 17 00:00:00 2001 From: JSoufer Date: Fri, 18 Oct 2024 11:17:55 +0100 Subject: [PATCH 02/15] add build step for copying --- scripts/build.sh | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/scripts/build.sh b/scripts/build.sh index 1a8fae27194..110c08ba013 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -177,6 +177,17 @@ prebuild_ios(){ echo "" > ios/debug.xcconfig echo "" > ios/release.xcconfig fi + + #Create GoogleService-Info.plist file to be used by the Firebase services. + # Check if GOOGLE_SERVICES_B64_IOS is set + if [ ! -z "$GOOGLE_SERVICES_B64_IOS" ]; then + echo -n $GOOGLE_SERVICES_B64_IOS | base64 -d > ./ios/GoogleServices/GoogleService-Info.plist + echo "GoogleService-Info.plist has been created successfully." + else + echo "GOOGLE_SERVICES_B64_IOS is not set in the .env file." + exit 1 + fi + # Required to install mixpanel dep git submodule update --init --recursive unset PREFIX @@ -190,12 +201,12 @@ prebuild_android(){ yes | cp -rf ./app/fonts/Metamask.ttf ./android/app/src/main/assets/fonts/Metamask.ttf #Create google-services.json file to be used by the Firebase services. - # Check if GOOGLE_SERVICES_B64 is set - if [ ! -z "$GOOGLE_SERVICES_B64" ]; then - echo -n $GOOGLE_SERVICES_B64 | base64 -d > ./android/app/google-services.json + # Check if GOOGLE_SERVICES_B64_ANDROID is set + if [ ! -z "$GOOGLE_SERVICES_B64_ANDROID" ]; then + echo -n $GOOGLE_SERVICES_B64_ANDROID | base64 -d > ./android/app/google-services.json echo "google-services.json has been created successfully." else - echo "GOOGLE_SERVICES_B64 is not set in the .env file." + echo "GOOGLE_SERVICES_B64_ANDROID is not set in the .env file." exit 1 fi @@ -626,4 +637,4 @@ else else envFileMissing $ANDROID_ENV_FILE fi -fi \ No newline at end of file +fi From 5acf4da8ff40279bbe8b4b9a91debff0e3740a43 Mon Sep 17 00:00:00 2001 From: JSoufer Date: Fri, 18 Oct 2024 11:23:16 +0100 Subject: [PATCH 03/15] create separated folder for Google Services --- ios/MetaMask.xcodeproj/project.pbxproj | 28 +++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/ios/MetaMask.xcodeproj/project.pbxproj b/ios/MetaMask.xcodeproj/project.pbxproj index 314bc34f316..492bfe8c2cf 100644 --- a/ios/MetaMask.xcodeproj/project.pbxproj +++ b/ios/MetaMask.xcodeproj/project.pbxproj @@ -3,13 +3,13 @@ archiveVersion = 1; classes = { }; - objectVersion = 56; + objectVersion = 70; objects = { /* Begin PBXBuildFile section */ 07CBADD9D4B441008304F8D3 /* EuclidCircularB-Light.otf in Resources */ = {isa = PBXBuildFile; fileRef = A98029A3662F4C1391489A6B /* EuclidCircularB-Light.otf */; }; 08B7A641467C4723B98328E9 /* CentraNo1-Medium.otf in Resources */ = {isa = PBXBuildFile; fileRef = F97653CAD1D04E1B8713C428 /* CentraNo1-Medium.otf */; }; - 0FD509E0336BF221F6527B24 /* BuildFile in Frameworks */ = {isa = PBXBuildFile; }; + 0FD509E0336BF221F6527B24 /* (null) in Frameworks */ = {isa = PBXBuildFile; }; 13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.m */; }; 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; }; 13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; }; @@ -134,7 +134,7 @@ B339FF2E289ABD70001B89FB /* EuclidCircularB-SemiboldItalic.otf in Resources */ = {isa = PBXBuildFile; fileRef = 9499B01ECAC44DA29AC44E80 /* EuclidCircularB-SemiboldItalic.otf */; }; B339FF32289ABD70001B89FB /* Branch.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 153F84C92319B8DB00C19B63 /* Branch.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; B339FF3C289ABF2C001B89FB /* MetaMask-QA-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = B339FEA72899852C001B89FB /* MetaMask-QA-Info.plist */; }; - B638844E306CAE9147B52C85 /* BuildFile in Frameworks */ = {isa = PBXBuildFile; }; + B638844E306CAE9147B52C85 /* (null) in Frameworks */ = {isa = PBXBuildFile; }; BF39E5BAE0F34F9091FF6AC0 /* EuclidCircularB-Semibold.otf in Resources */ = {isa = PBXBuildFile; fileRef = A8DE9C5BC0714D648276E123 /* EuclidCircularB-Semibold.otf */; }; CD13D926E1E84D9ABFE672C0 /* Roboto-BlackItalic.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 3E2492C67CF345CABD7B8601 /* Roboto-BlackItalic.ttf */; }; CF9895772A3B49BE00B4C9B5 /* RCTMinimizer.m in Sources */ = {isa = PBXBuildFile; fileRef = CF9895762A3B49BE00B4C9B5 /* RCTMinimizer.m */; }; @@ -142,7 +142,7 @@ CF98DA9C28D9FEB700096782 /* RCTScreenshotDetect.m in Sources */ = {isa = PBXBuildFile; fileRef = CF98DA9B28D9FEB700096782 /* RCTScreenshotDetect.m */; }; CFD8DFC828EDD4C800CC75F6 /* RCTScreenshotDetect.m in Sources */ = {isa = PBXBuildFile; fileRef = CF98DA9B28D9FEB700096782 /* RCTScreenshotDetect.m */; }; D171C39A8BD44DBEB6B68480 /* EuclidCircularB-MediumItalic.otf in Resources */ = {isa = PBXBuildFile; fileRef = 42CBA652072F4BE2A8B815C1 /* EuclidCircularB-MediumItalic.otf */; }; - D45BF85DECACCB74EDCBE88A /* BuildFile in Frameworks */ = {isa = PBXBuildFile; }; + D45BF85DECACCB74EDCBE88A /* (null) in Frameworks */ = {isa = PBXBuildFile; }; D5BA0E32DFAA451781D5093E /* CentraNo1-BoldItalic.otf in Resources */ = {isa = PBXBuildFile; fileRef = 4560812198A247039A1CF5A5 /* CentraNo1-BoldItalic.otf */; }; DADE8F39CE81410A98B9B805 /* MMSans-Regular.otf in Resources */ = {isa = PBXBuildFile; fileRef = 2EBD310362314C3ABFF40AD1 /* MMSans-Regular.otf */; }; DC6A024F56DD43E1A83B47B1 /* Roboto-MediumItalic.ttf in Resources */ = {isa = PBXBuildFile; fileRef = D5FF0FF1DFB74B3C8BB99E09 /* Roboto-MediumItalic.ttf */; }; @@ -328,6 +328,10 @@ FE3C9A2458A1416290DEDAD4 /* branch.json */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = branch.json; path = ../branch.json; sourceTree = ""; }; /* End PBXFileReference section */ +/* Begin PBXFileSystemSynchronizedRootGroup section */ + C8FB8D032CC26E2500198964 /* GoogleServices */ = {isa = PBXFileSystemSynchronizedRootGroup; explicitFileTypes = {}; explicitFolders = (); path = GoogleServices; sourceTree = ""; }; +/* End PBXFileSystemSynchronizedRootGroup section */ + /* Begin PBXFrameworksBuildPhase section */ 13B07F8C1A680F5B00A75B9A /* Frameworks */ = { isa = PBXFrameworksBuildPhase; @@ -337,9 +341,9 @@ 650F2B9D24DC5FF200C3B9C4 /* libRCTAesForked.a in Frameworks */, 153C1ABB2217BCDC0088EFE0 /* JavaScriptCore.framework in Frameworks */, 153F84CA2319B8FD00C19B63 /* Branch.framework in Frameworks */, - 0FD509E0336BF221F6527B24 /* BuildFile in Frameworks */, - D45BF85DECACCB74EDCBE88A /* BuildFile in Frameworks */, - B638844E306CAE9147B52C85 /* BuildFile in Frameworks */, + 0FD509E0336BF221F6527B24 /* (null) in Frameworks */, + D45BF85DECACCB74EDCBE88A /* (null) in Frameworks */, + B638844E306CAE9147B52C85 /* (null) in Frameworks */, ED2E8FE6D71BE9319F3B27D3 /* libPods-MetaMask.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; @@ -391,6 +395,7 @@ 13B07FAE1A68108700A75B9A /* MetaMask */ = { isa = PBXGroup; children = ( + C8FB8D032CC26E2500198964 /* GoogleServices */, E83DB5392BBDB14700536063 /* PrivacyInfo.xcprivacy */, B339FEA72899852C001B89FB /* MetaMask-QA-Info.plist */, AA9EDF17249955C7005D89EE /* MetaMaskDebug.entitlements */, @@ -618,6 +623,9 @@ dependencies = ( 153F84CD2319B8FD00C19B63 /* PBXTargetDependency */, ); + fileSystemSynchronizedGroups = ( + C8FB8D032CC26E2500198964 /* GoogleServices */, + ); name = MetaMask; productName = "Hello World"; productReference = 13B07F961A680F5B00A75B9A /* MetaMask.app */; @@ -643,6 +651,9 @@ dependencies = ( 2EF282552B0FF86900D7B4B1 /* PBXTargetDependency */, ); + fileSystemSynchronizedGroups = ( + C8FB8D032CC26E2500198964 /* GoogleServices */, + ); name = "MetaMask-Flask"; productName = "Hello World"; productReference = 2EF282922B0FF86900D7B4B1 /* MetaMask-Flask.app */; @@ -668,6 +679,9 @@ dependencies = ( B339FEFD289ABD70001B89FB /* PBXTargetDependency */, ); + fileSystemSynchronizedGroups = ( + C8FB8D032CC26E2500198964 /* GoogleServices */, + ); name = "MetaMask-QA"; productName = "Hello World"; productReference = B339FF39289ABD70001B89FB /* MetaMask-QA.app */; From aa87720a3a7397d027ca4b123cb3e1414371203b Mon Sep 17 00:00:00 2001 From: JSoufer Date: Fri, 18 Oct 2024 11:34:32 +0100 Subject: [PATCH 04/15] update documentation --- .android.env.example | 3 ++- .ios.env.example | 2 +- .js.env.example | 3 ++- README.md | 13 +++++++++---- 4 files changed, 14 insertions(+), 7 deletions(-) diff --git a/.android.env.example b/.android.env.example index 93b4a8c334e..72e247a33c6 100644 --- a/.android.env.example +++ b/.android.env.example @@ -9,7 +9,8 @@ export FCM_CONFIG_PROJECT_ID= export FCM_CONFIG_STORAGE_BUCKET= export FCM_CONFIG_MESSAGING_SENDER_ID= export FCM_CONFIG_APP_ID= -export GOOGLE_SERVICES_B64= +export GOOGLE_SERVICES_B64_ANDROID= + #Notifications Feature Announcements export FEATURES_ANNOUNCEMENTS_ACCESS_TOKEN= export FEATURES_ANNOUNCEMENTS_SPACE_ID= diff --git a/.ios.env.example b/.ios.env.example index 05aadc9b359..107bd835f3e 100644 --- a/.ios.env.example +++ b/.ios.env.example @@ -8,7 +8,7 @@ FCM_CONFIG_PROJECT_ID= FCM_CONFIG_STORAGE_BUCKET= FCM_CONFIG_MESSAGING_SENDER_ID= FCM_CONFIG_APP_ID= -GOOGLE_SERVICES_B64= +GOOGLE_SERVICES_B64_IOS.ios.env.example= #Notifications Feature Announcements FEATURES_ANNOUNCEMENTS_ACCESS_TOKEN= FEATURES_ANNOUNCEMENTS_SPACE_ID= diff --git a/.js.env.example b/.js.env.example index 68e8316f034..3ffe21260d6 100644 --- a/.js.env.example +++ b/.js.env.example @@ -79,7 +79,8 @@ export FCM_CONFIG_PROJECT_ID="" export FCM_CONFIG_STORAGE_BUCKET="" export FCM_CONFIG_MESSAGING_SENDER_ID="" export FCM_CONFIG_APP_ID="" -export GOOGLE_SERVICES_B64="" +export GOOGLE_SERVICES_B64_ANDROID="" +export GOOGLE_SERVICES_B64_IOS="" #Notifications Feature Announcements export FEATURES_ANNOUNCEMENTS_ACCESS_TOKEN= export FEATURES_ANNOUNCEMENTS_SPACE_ID= diff --git a/README.md b/README.md index 2c4a6de0445..4b8d6f140c1 100644 --- a/README.md +++ b/README.md @@ -41,20 +41,25 @@ cd metamask-mobile **Firebase Messaging Setup** -Before running the app, keep in mind that MetaMask uses FCM (Firebase Cloud Message) to empower communications. Based on this, as an external contributor you would preferably need to provide your own FREE Firebase project config file with a matching client for package name `io.metamask`, and update your `google-services.json` file in the `android/app` directory as well your `.env` files (`.ios.env`, `.js.env`, `.android.env`), adding `GOOGLE_SERVICES_B64` variable depending on the environment you are running the app (ios/android). +Before running the app, keep in mind that MetaMask uses FCM (Firebase Cloud Message) to empower communications. Based on this, as an external contributor you would preferably need to provide your own FREE Firebase project config file with a matching client for package name `io.metamask`, and update your `google-services.json` or `GoogleService-Info.plist` file in the `android/app` or `ios/GoogleServices` directory `.env` files (`.ios.env`, `.js.env`, `.android.env`), adding `GOOGLE_SERVICES_B64_ANDROID` or `GOOGLE_SERVICES_B64_IOS` variable depending on the environment you are running the app (ios/android). -The value you should provide to `GOOGLE_SERVICES_B64` is the base64 encoded version of your Firebase project config file, which can be generated as follows: +The value you should provide to `GOOGLE_SERVICES_B64_ANDROID` or `GOOGLE_SERVICES_B64_IOS` is the base64 encoded version of your Firebase project config file, which can be generated as follows: +**For Android** ```bash base64 -i ./android/app/google-services-example.json ``` +**For iOS** +```bash +base64 -i ./ios/GoogleServices/GoogleService-Info-example.plist +``` -Copy the result to your clipboard and paste it in the `GOOGLE_SERVICES_B64` variable in the `.env` file you are running the app. +Copy the result to your clipboard and paste it in the `GOOGLE_SERVICES_B64_ANDROID` or `GOOGLE_SERVICES_B64_IOS` variable in the `.env` file you are running the app. > [!CAUTION] > In case you don't provide your own Firebase project config file, you will face the error `No matching client found for package name 'io.metamask'`. -You can make usage of a mock file at `android/app/google-services-example.json`, following the same steps above from the root of the project. +You can make usage of a mock file at `android/app/google-services-example.json` or `ios/GoogleServices/GoogleService-Info-example.plist`, following the same steps above from the root of the project. In case of any doubt, please follow the instructions in the link below to get your Firebase project config file. From bbf78d80ebd2a5c9b12ea9cbce9e55b0de9a39fa Mon Sep 17 00:00:00 2001 From: JSoufer Date: Fri, 18 Oct 2024 11:37:01 +0100 Subject: [PATCH 05/15] add mocked plist --- .../GoogleService-Info-example.plist | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 ios/GoogleServices/GoogleService-Info-example.plist diff --git a/ios/GoogleServices/GoogleService-Info-example.plist b/ios/GoogleServices/GoogleService-Info-example.plist new file mode 100644 index 00000000000..1294630b17d --- /dev/null +++ b/ios/GoogleServices/GoogleService-Info-example.plist @@ -0,0 +1,30 @@ + + + + + API_KEY + mock-api-key-1234 + GCM_SENDER_ID + mock-gcm-sender-id-1234 + PLIST_VERSION + 1 + BUNDLE_ID + io.metamask.MetaMask + PROJECT_ID + mockproject-1234 + STORAGE_BUCKET + mock-storage-bucket-1234.appspot.com + IS_ADS_ENABLED + + IS_ANALYTICS_ENABLED + + IS_APPINVITE_ENABLED + + IS_GCM_ENABLED + + IS_SIGNIN_ENABLED + + GOOGLE_APP_ID + mock-google-app-id-1234 + + From 5fbffb0731fd6cd58627cd62dbefef8b1d780438 Mon Sep 17 00:00:00 2001 From: JSoufer Date: Fri, 18 Oct 2024 12:02:08 +0100 Subject: [PATCH 06/15] fix typo --- .ios.env.example | 2 +- ios/GoogleServices/GoogleService-Info.plist | 30 +++++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 ios/GoogleServices/GoogleService-Info.plist diff --git a/.ios.env.example b/.ios.env.example index 107bd835f3e..cc449b8b6e1 100644 --- a/.ios.env.example +++ b/.ios.env.example @@ -8,7 +8,7 @@ FCM_CONFIG_PROJECT_ID= FCM_CONFIG_STORAGE_BUCKET= FCM_CONFIG_MESSAGING_SENDER_ID= FCM_CONFIG_APP_ID= -GOOGLE_SERVICES_B64_IOS.ios.env.example= +GOOGLE_SERVICES_B64_IOS= #Notifications Feature Announcements FEATURES_ANNOUNCEMENTS_ACCESS_TOKEN= FEATURES_ANNOUNCEMENTS_SPACE_ID= diff --git a/ios/GoogleServices/GoogleService-Info.plist b/ios/GoogleServices/GoogleService-Info.plist new file mode 100644 index 00000000000..1294630b17d --- /dev/null +++ b/ios/GoogleServices/GoogleService-Info.plist @@ -0,0 +1,30 @@ + + + + + API_KEY + mock-api-key-1234 + GCM_SENDER_ID + mock-gcm-sender-id-1234 + PLIST_VERSION + 1 + BUNDLE_ID + io.metamask.MetaMask + PROJECT_ID + mockproject-1234 + STORAGE_BUCKET + mock-storage-bucket-1234.appspot.com + IS_ADS_ENABLED + + IS_ANALYTICS_ENABLED + + IS_APPINVITE_ENABLED + + IS_GCM_ENABLED + + IS_SIGNIN_ENABLED + + GOOGLE_APP_ID + mock-google-app-id-1234 + + From 3117faefd631ea9e384ec6ed5e2df41f53d2bea8 Mon Sep 17 00:00:00 2001 From: JSoufer Date: Fri, 18 Oct 2024 12:29:33 +0100 Subject: [PATCH 07/15] add plist resource on ios --- ios/{GoogleServices => }/GoogleService-Info.plist | 0 ios/MetaMask.xcodeproj/project.pbxproj | 8 ++++++++ 2 files changed, 8 insertions(+) rename ios/{GoogleServices => }/GoogleService-Info.plist (100%) diff --git a/ios/GoogleServices/GoogleService-Info.plist b/ios/GoogleService-Info.plist similarity index 100% rename from ios/GoogleServices/GoogleService-Info.plist rename to ios/GoogleService-Info.plist diff --git a/ios/MetaMask.xcodeproj/project.pbxproj b/ios/MetaMask.xcodeproj/project.pbxproj index 492bfe8c2cf..9b281bfd048 100644 --- a/ios/MetaMask.xcodeproj/project.pbxproj +++ b/ios/MetaMask.xcodeproj/project.pbxproj @@ -136,6 +136,9 @@ B339FF3C289ABF2C001B89FB /* MetaMask-QA-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = B339FEA72899852C001B89FB /* MetaMask-QA-Info.plist */; }; B638844E306CAE9147B52C85 /* (null) in Frameworks */ = {isa = PBXBuildFile; }; BF39E5BAE0F34F9091FF6AC0 /* EuclidCircularB-Semibold.otf in Resources */ = {isa = PBXBuildFile; fileRef = A8DE9C5BC0714D648276E123 /* EuclidCircularB-Semibold.otf */; }; + C8D12C552CC27D9600A1EA42 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = C8D12C542CC27D9600A1EA42 /* GoogleService-Info.plist */; }; + C8D12C562CC27D9600A1EA42 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = C8D12C542CC27D9600A1EA42 /* GoogleService-Info.plist */; }; + C8D12C572CC27D9600A1EA42 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = C8D12C542CC27D9600A1EA42 /* GoogleService-Info.plist */; }; CD13D926E1E84D9ABFE672C0 /* Roboto-BlackItalic.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 3E2492C67CF345CABD7B8601 /* Roboto-BlackItalic.ttf */; }; CF9895772A3B49BE00B4C9B5 /* RCTMinimizer.m in Sources */ = {isa = PBXBuildFile; fileRef = CF9895762A3B49BE00B4C9B5 /* RCTMinimizer.m */; }; CF9895782A3B49BE00B4C9B5 /* RCTMinimizer.m in Sources */ = {isa = PBXBuildFile; fileRef = CF9895762A3B49BE00B4C9B5 /* RCTMinimizer.m */; }; @@ -302,6 +305,7 @@ BCC95B62DD6241678CDF73B3 /* CentraNo1-BookItalic.otf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = "CentraNo1-BookItalic.otf"; path = "../app/fonts/CentraNo1-BookItalic.otf"; sourceTree = ""; }; BF485CDA047B4D52852B87F5 /* EvilIcons.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = EvilIcons.ttf; path = "../node_modules/react-native-vector-icons/Fonts/EvilIcons.ttf"; sourceTree = ""; }; C752564A28B44392AEE16BD5 /* Roboto-Medium.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = "Roboto-Medium.ttf"; path = "../app/fonts/Roboto-Medium.ttf"; sourceTree = ""; }; + C8D12C542CC27D9600A1EA42 /* GoogleService-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = ""; }; C9FD3FB1258A41A5A0546C83 /* Roboto-BoldItalic.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = "Roboto-BoldItalic.ttf"; path = "../app/fonts/Roboto-BoldItalic.ttf"; sourceTree = ""; }; CE0434C5FB7C4C6F9FEBDCE2 /* EuclidCircularB-Medium.otf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = "EuclidCircularB-Medium.otf"; path = "../app/fonts/EuclidCircularB-Medium.otf"; sourceTree = ""; }; CF014205BB8964CFE74D4D8E /* Pods-MetaMask-QA.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-MetaMask-QA.release.xcconfig"; path = "Target Support Files/Pods-MetaMask-QA/Pods-MetaMask-QA.release.xcconfig"; sourceTree = ""; }; @@ -538,6 +542,7 @@ 83CBB9F61A601CBA00E9B192 = { isa = PBXGroup; children = ( + C8D12C542CC27D9600A1EA42 /* GoogleService-Info.plist */, 2EF283352B17EC4E00D7B4B1 /* Light-Swift-Untar-V2 */, 2EF283312B17EC1A00D7B4B1 /* RNTar.m */, 2EF283292B17EBD600D7B4B1 /* RnTar.swift */, @@ -800,6 +805,7 @@ 08B7A641467C4723B98328E9 /* CentraNo1-Medium.otf in Resources */, 7F5D30C6178D467D96653D0F /* CentraNo1-MediumItalic.otf in Resources */, 3466654F43654D36B5D478CA /* config.json in Resources */, + C8D12C572CC27D9600A1EA42 /* GoogleService-Info.plist in Resources */, DADE8F39CE81410A98B9B805 /* MMSans-Regular.otf in Resources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -816,6 +822,7 @@ 2EF2826F2B0FF86900D7B4B1 /* Roboto-BlackItalic.ttf in Resources */, E83DB5542BBDF2AF00536063 /* PrivacyInfo.xcprivacy in Resources */, 2EF282702B0FF86900D7B4B1 /* Roboto-Bold.ttf in Resources */, + C8D12C562CC27D9600A1EA42 /* GoogleService-Info.plist in Resources */, 2EF282712B0FF86900D7B4B1 /* debug.xcconfig in Resources */, 2EF282722B0FF86900D7B4B1 /* Roboto-BoldItalic.ttf in Resources */, 2EF282732B0FF86900D7B4B1 /* Roboto-Italic.ttf in Resources */, @@ -874,6 +881,7 @@ B339FF29289ABD70001B89FB /* EuclidCircularB-Medium.otf in Resources */, B339FF2A289ABD70001B89FB /* EuclidCircularB-MediumItalic.otf in Resources */, B339FF3C289ABF2C001B89FB /* MetaMask-QA-Info.plist in Resources */, + C8D12C552CC27D9600A1EA42 /* GoogleService-Info.plist in Resources */, B339FF2B289ABD70001B89FB /* EuclidCircularB-Regular.otf in Resources */, B339FF2C289ABD70001B89FB /* EuclidCircularB-RegularItalic.otf in Resources */, B339FF2D289ABD70001B89FB /* EuclidCircularB-Semibold.otf in Resources */, From 62085095e26cee92eda542d79653e96e8dae15f2 Mon Sep 17 00:00:00 2001 From: JSoufer Date: Fri, 18 Oct 2024 12:30:58 +0100 Subject: [PATCH 08/15] fix path --- scripts/build.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/build.sh b/scripts/build.sh index cd510c81048..c55da8fce0b 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -182,7 +182,7 @@ prebuild_ios(){ #Create GoogleService-Info.plist file to be used by the Firebase services. # Check if GOOGLE_SERVICES_B64_IOS is set if [ ! -z "$GOOGLE_SERVICES_B64_IOS" ]; then - echo -n $GOOGLE_SERVICES_B64_IOS | base64 -d > ./ios/GoogleServices/GoogleService-Info.plist + echo -n $GOOGLE_SERVICES_B64_IOS | base64 -d > ./ios/GoogleService-Info.plist echo "GoogleService-Info.plist has been created successfully." else echo "GOOGLE_SERVICES_B64_IOS is not set in the .env file." @@ -638,4 +638,4 @@ else else envFileMissing $ANDROID_ENV_FILE fi -fi \ No newline at end of file +fi From ad20caf13874d29bc4f40ca2351e2cd80c77a822 Mon Sep 17 00:00:00 2001 From: JSoufer Date: Sun, 20 Oct 2024 07:32:12 +0100 Subject: [PATCH 09/15] fix iOs build --- ios/MetaMask.xcodeproj/project.pbxproj | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/ios/MetaMask.xcodeproj/project.pbxproj b/ios/MetaMask.xcodeproj/project.pbxproj index 9b281bfd048..5a52481ccdc 100644 --- a/ios/MetaMask.xcodeproj/project.pbxproj +++ b/ios/MetaMask.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 70; + objectVersion = 56; objects = { /* Begin PBXBuildFile section */ @@ -332,10 +332,6 @@ FE3C9A2458A1416290DEDAD4 /* branch.json */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = branch.json; path = ../branch.json; sourceTree = ""; }; /* End PBXFileReference section */ -/* Begin PBXFileSystemSynchronizedRootGroup section */ - C8FB8D032CC26E2500198964 /* GoogleServices */ = {isa = PBXFileSystemSynchronizedRootGroup; explicitFileTypes = {}; explicitFolders = (); path = GoogleServices; sourceTree = ""; }; -/* End PBXFileSystemSynchronizedRootGroup section */ - /* Begin PBXFrameworksBuildPhase section */ 13B07F8C1A680F5B00A75B9A /* Frameworks */ = { isa = PBXFrameworksBuildPhase; @@ -587,6 +583,13 @@ path = Pods; sourceTree = ""; }; + C8FB8D032CC26E2500198964 /* GoogleServices */ = { + isa = PBXGroup; + children = ( + ); + path = GoogleServices; + sourceTree = ""; + }; CF9895742A3B48DC00B4C9B5 /* RCTMinimizer */ = { isa = PBXGroup; children = ( @@ -628,9 +631,6 @@ dependencies = ( 153F84CD2319B8FD00C19B63 /* PBXTargetDependency */, ); - fileSystemSynchronizedGroups = ( - C8FB8D032CC26E2500198964 /* GoogleServices */, - ); name = MetaMask; productName = "Hello World"; productReference = 13B07F961A680F5B00A75B9A /* MetaMask.app */; @@ -656,9 +656,6 @@ dependencies = ( 2EF282552B0FF86900D7B4B1 /* PBXTargetDependency */, ); - fileSystemSynchronizedGroups = ( - C8FB8D032CC26E2500198964 /* GoogleServices */, - ); name = "MetaMask-Flask"; productName = "Hello World"; productReference = 2EF282922B0FF86900D7B4B1 /* MetaMask-Flask.app */; @@ -684,9 +681,6 @@ dependencies = ( B339FEFD289ABD70001B89FB /* PBXTargetDependency */, ); - fileSystemSynchronizedGroups = ( - C8FB8D032CC26E2500198964 /* GoogleServices */, - ); name = "MetaMask-QA"; productName = "Hello World"; productReference = B339FF39289ABD70001B89FB /* MetaMask-QA.app */; From b050e4bb886c95ba3cee59fdfffbbd43740f4bae Mon Sep 17 00:00:00 2001 From: JSoufer Date: Mon, 21 Oct 2024 12:33:41 +0100 Subject: [PATCH 10/15] add iOS pre build actions --- .../xcshareddata/xcschemes/MetaMask-QA.xcscheme | 9 +++++++++ .../xcshareddata/xcschemes/MetaMask.xcscheme | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/ios/MetaMask.xcodeproj/xcshareddata/xcschemes/MetaMask-QA.xcscheme b/ios/MetaMask.xcodeproj/xcshareddata/xcschemes/MetaMask-QA.xcscheme index c6cf377abfa..f2bae44c32e 100644 --- a/ios/MetaMask.xcodeproj/xcshareddata/xcschemes/MetaMask-QA.xcscheme +++ b/ios/MetaMask.xcodeproj/xcshareddata/xcschemes/MetaMask-QA.xcscheme @@ -5,6 +5,15 @@ + + + + + + + + + + + + Date: Tue, 22 Oct 2024 10:48:17 +0100 Subject: [PATCH 11/15] add preBuild script --- .../xcschemes/MetaMask-Flask.xcscheme | 87 +++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 ios/MetaMask.xcodeproj/xcshareddata/xcschemes/MetaMask-Flask.xcscheme diff --git a/ios/MetaMask.xcodeproj/xcshareddata/xcschemes/MetaMask-Flask.xcscheme b/ios/MetaMask.xcodeproj/xcshareddata/xcschemes/MetaMask-Flask.xcscheme new file mode 100644 index 00000000000..2eb2486fca3 --- /dev/null +++ b/ios/MetaMask.xcodeproj/xcshareddata/xcschemes/MetaMask-Flask.xcscheme @@ -0,0 +1,87 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From d6740245e228a85b8b145f52814e853a3ab3207e Mon Sep 17 00:00:00 2001 From: JSoufer Date: Wed, 23 Oct 2024 15:15:54 +0100 Subject: [PATCH 12/15] update iOS schema --- ios/MetaMask.xcodeproj/project.pbxproj | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ios/MetaMask.xcodeproj/project.pbxproj b/ios/MetaMask.xcodeproj/project.pbxproj index 5a52481ccdc..4abb8200b0e 100644 --- a/ios/MetaMask.xcodeproj/project.pbxproj +++ b/ios/MetaMask.xcodeproj/project.pbxproj @@ -9,7 +9,7 @@ /* Begin PBXBuildFile section */ 07CBADD9D4B441008304F8D3 /* EuclidCircularB-Light.otf in Resources */ = {isa = PBXBuildFile; fileRef = A98029A3662F4C1391489A6B /* EuclidCircularB-Light.otf */; }; 08B7A641467C4723B98328E9 /* CentraNo1-Medium.otf in Resources */ = {isa = PBXBuildFile; fileRef = F97653CAD1D04E1B8713C428 /* CentraNo1-Medium.otf */; }; - 0FD509E0336BF221F6527B24 /* (null) in Frameworks */ = {isa = PBXBuildFile; }; + 0FD509E0336BF221F6527B24 /* BuildFile in Frameworks */ = {isa = PBXBuildFile; }; 13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.m */; }; 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; }; 13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; }; @@ -134,7 +134,7 @@ B339FF2E289ABD70001B89FB /* EuclidCircularB-SemiboldItalic.otf in Resources */ = {isa = PBXBuildFile; fileRef = 9499B01ECAC44DA29AC44E80 /* EuclidCircularB-SemiboldItalic.otf */; }; B339FF32289ABD70001B89FB /* Branch.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 153F84C92319B8DB00C19B63 /* Branch.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; B339FF3C289ABF2C001B89FB /* MetaMask-QA-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = B339FEA72899852C001B89FB /* MetaMask-QA-Info.plist */; }; - B638844E306CAE9147B52C85 /* (null) in Frameworks */ = {isa = PBXBuildFile; }; + B638844E306CAE9147B52C85 /* BuildFile in Frameworks */ = {isa = PBXBuildFile; }; BF39E5BAE0F34F9091FF6AC0 /* EuclidCircularB-Semibold.otf in Resources */ = {isa = PBXBuildFile; fileRef = A8DE9C5BC0714D648276E123 /* EuclidCircularB-Semibold.otf */; }; C8D12C552CC27D9600A1EA42 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = C8D12C542CC27D9600A1EA42 /* GoogleService-Info.plist */; }; C8D12C562CC27D9600A1EA42 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = C8D12C542CC27D9600A1EA42 /* GoogleService-Info.plist */; }; @@ -145,7 +145,7 @@ CF98DA9C28D9FEB700096782 /* RCTScreenshotDetect.m in Sources */ = {isa = PBXBuildFile; fileRef = CF98DA9B28D9FEB700096782 /* RCTScreenshotDetect.m */; }; CFD8DFC828EDD4C800CC75F6 /* RCTScreenshotDetect.m in Sources */ = {isa = PBXBuildFile; fileRef = CF98DA9B28D9FEB700096782 /* RCTScreenshotDetect.m */; }; D171C39A8BD44DBEB6B68480 /* EuclidCircularB-MediumItalic.otf in Resources */ = {isa = PBXBuildFile; fileRef = 42CBA652072F4BE2A8B815C1 /* EuclidCircularB-MediumItalic.otf */; }; - D45BF85DECACCB74EDCBE88A /* (null) in Frameworks */ = {isa = PBXBuildFile; }; + D45BF85DECACCB74EDCBE88A /* BuildFile in Frameworks */ = {isa = PBXBuildFile; }; D5BA0E32DFAA451781D5093E /* CentraNo1-BoldItalic.otf in Resources */ = {isa = PBXBuildFile; fileRef = 4560812198A247039A1CF5A5 /* CentraNo1-BoldItalic.otf */; }; DADE8F39CE81410A98B9B805 /* MMSans-Regular.otf in Resources */ = {isa = PBXBuildFile; fileRef = 2EBD310362314C3ABFF40AD1 /* MMSans-Regular.otf */; }; DC6A024F56DD43E1A83B47B1 /* Roboto-MediumItalic.ttf in Resources */ = {isa = PBXBuildFile; fileRef = D5FF0FF1DFB74B3C8BB99E09 /* Roboto-MediumItalic.ttf */; }; @@ -341,9 +341,9 @@ 650F2B9D24DC5FF200C3B9C4 /* libRCTAesForked.a in Frameworks */, 153C1ABB2217BCDC0088EFE0 /* JavaScriptCore.framework in Frameworks */, 153F84CA2319B8FD00C19B63 /* Branch.framework in Frameworks */, - 0FD509E0336BF221F6527B24 /* (null) in Frameworks */, - D45BF85DECACCB74EDCBE88A /* (null) in Frameworks */, - B638844E306CAE9147B52C85 /* (null) in Frameworks */, + 0FD509E0336BF221F6527B24 /* BuildFile in Frameworks */, + D45BF85DECACCB74EDCBE88A /* BuildFile in Frameworks */, + B638844E306CAE9147B52C85 /* BuildFile in Frameworks */, ED2E8FE6D71BE9319F3B27D3 /* libPods-MetaMask.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; From 56dc31e894d879629424067c1f8aca5c0cc0bbd8 Mon Sep 17 00:00:00 2001 From: JSoufer Date: Wed, 23 Oct 2024 22:20:54 +0100 Subject: [PATCH 13/15] update README --- README.md | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index c38183f6f80..67a385c2762 100644 --- a/README.md +++ b/README.md @@ -41,25 +41,21 @@ cd metamask-mobile **Firebase Messaging Setup** -Before running the app, keep in mind that MetaMask uses FCM (Firebase Cloud Message) to empower communications. Based on this, as an external contributor you would preferably need to provide your own FREE Firebase project config file with a matching client for package name `io.metamask`, and update your `google-services.json` or `GoogleService-Info.plist` file in the `android/app` or `ios/GoogleServices` directory `.env` files (`.ios.env`, `.js.env`, `.android.env`), adding `GOOGLE_SERVICES_B64_ANDROID` or `GOOGLE_SERVICES_B64_IOS` variable depending on the environment you are running the app (ios/android). +Before running the app, keep in mind that MetaMask uses FCM (Firebase Cloud Message) to empower communications. Based on this, as an external contributor you would preferably need to provide your own FREE Firebase project config file with a matching client for package name `io.metamask`, and update your `google-services.json` file in the `android/app` or `GoogleService-Info.plist` file in the `ios` directory. In case you don't have FCM account, you can use `./android/app/google-services-example.json` for Android or `./ios/GoogleServices/GoogleService-Info-example.plist` for iOS and follow the steps below to populate the correct environment variables in the `.env` files (`.ios.env`, `.js.env`, `.android.env`), adding `GOOGLE_SERVICES_B64_ANDROID` or `GOOGLE_SERVICES_B64_IOS` variable depending on the environment you are running the app (ios/android). The value you should provide to `GOOGLE_SERVICES_B64_ANDROID` or `GOOGLE_SERVICES_B64_IOS` is the base64 encoded version of your Firebase project config file, which can be generated as follows: **For Android** ```bash -echo "export GOOGLE_SERVICES_B64=\"$(base64 -w0 -i ./android/app/google-services-example.json)\"" | tee -a .js.env .ios.env .android.env +echo "export GOOGLE_SERVICES_B64_ANDROID=\"$(base64 -w0 -i ./android/app/google-services-example.json)\"" | tee -a .js.env .android.env ``` **For iOS** ```bash -base64 -i ./ios/GoogleServices/GoogleService-Info-example.plist +echo "export GOOGLE_SERVICES_B64_IOS=\"$(base64 -w0 -i ./ios/GoogleServices/GoogleService-Info-example.plist)\"" | tee -a .js.env .ios.env ``` -Copy the result to your clipboard and paste it in the `GOOGLE_SERVICES_B64_ANDROID` or `GOOGLE_SERVICES_B64_IOS` variable in the `.env` file you are running the app. - > [!CAUTION] -> In case you don't provide your own Firebase project config file, you will face the error `No matching client found for package name 'io.metamask'`. - -You can make usage of a mock file at `android/app/google-services-example.json` or `ios/GoogleServices/GoogleService-Info-example.plist`, following the same steps above from the root of the project. +> In case you don't provide your own Firebase project config file or run the steps above, you will face the error `No matching client found for package name 'io.metamask'`. In case of any doubt, please follow the instructions in the link below to get your Firebase project config file. From cd6f12be860ba90b1b9a0835849f5618b9e08a21 Mon Sep 17 00:00:00 2001 From: JSoufer Date: Thu, 24 Oct 2024 14:59:27 +0100 Subject: [PATCH 14/15] remove pre build stage --- .../xcshareddata/xcschemes/MetaMask-Flask.xcscheme | 9 --------- .../xcshareddata/xcschemes/MetaMask-QA.xcscheme | 9 --------- .../xcshareddata/xcschemes/MetaMask.xcscheme | 9 --------- 3 files changed, 27 deletions(-) diff --git a/ios/MetaMask.xcodeproj/xcshareddata/xcschemes/MetaMask-Flask.xcscheme b/ios/MetaMask.xcodeproj/xcshareddata/xcschemes/MetaMask-Flask.xcscheme index 2eb2486fca3..a2de5b96b99 100644 --- a/ios/MetaMask.xcodeproj/xcshareddata/xcschemes/MetaMask-Flask.xcscheme +++ b/ios/MetaMask.xcodeproj/xcshareddata/xcschemes/MetaMask-Flask.xcscheme @@ -6,15 +6,6 @@ parallelizeBuildables = "YES" buildImplicitDependencies = "YES" buildArchitectures = "Automatic"> - - - - - - - - - - - - - - - - - - Date: Thu, 24 Oct 2024 19:29:08 +0100 Subject: [PATCH 15/15] add model of GoogleService file --- ios/GoogleService-Info.plist | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/ios/GoogleService-Info.plist b/ios/GoogleService-Info.plist index 1294630b17d..8410def31e2 100644 --- a/ios/GoogleService-Info.plist +++ b/ios/GoogleService-Info.plist @@ -3,21 +3,17 @@ API_KEY - mock-api-key-1234 + $(FCM_CONFIG_API_KEY) GCM_SENDER_ID - mock-gcm-sender-id-1234 + $(FCM_CONFIG_MESSAGING_SENDER_ID) PLIST_VERSION 1 BUNDLE_ID - io.metamask.MetaMask + $(PRODUCT_BUNDLE_IDENTIFIER) PROJECT_ID - mockproject-1234 + $(FCM_CONFIG_PROJECT_ID) STORAGE_BUCKET - mock-storage-bucket-1234.appspot.com - IS_ADS_ENABLED - - IS_ANALYTICS_ENABLED - + $(FCM_CONFIG_STORAGE_BUCKET) IS_APPINVITE_ENABLED IS_GCM_ENABLED @@ -25,6 +21,6 @@ IS_SIGNIN_ENABLED GOOGLE_APP_ID - mock-google-app-id-1234 + $(FCM_CONFIG_APP_ID)