diff --git a/.mx/known_dependencies.json b/.mx/known_dependencies.json index 05d0353ef..8038eeb95 100644 --- a/.mx/known_dependencies.json +++ b/.mx/known_dependencies.json @@ -1,7 +1,7 @@ { - "@react-native-firebase/app": "17.3.0", - "@react-native-firebase/messaging": "17.3.0", - "@react-native-firebase/crashlytics": "17.3.0", + "@react-native-firebase/app": "20.1.0", + "@react-native-firebase/messaging": "20.1.0", + "@react-native-firebase/crashlytics": "20.1.0", "@notifee/react-native": "9.1.8", "react-native-maps": "0.31.1" } diff --git a/android/build.gradle b/android/build.gradle index f8c37a7d6..4ae18437c 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -36,6 +36,22 @@ buildscript { } } + +project.ext { + set('react-native', [ + versions: [ + // Override Firebase BOM version to avoid updating to react-native-firebase 20.2.0+, + // which adds many new node_modules increasing the size significantly. + // Affected dependencies include the entire react-native-firebase suite e.g.: + // @react-native-firebase/app, @react-native-firebase/analytics, @react-native-firebase/crashlytics, @react-native-firebase/messaging + // NOTE: If updating to react-native-firebase 20.2.0+ is done, this override should be removed. + firebase: [ + bom: "33.1.1" + ], + ], + ]) +} + allprojects { repositories { all { repo -> diff --git a/intermediary-patches/@react-native-firebase+messaging+17.3.0.patch b/intermediary-patches/@react-native-firebase+messaging+17.3.0.patch deleted file mode 100644 index b7f285fad..000000000 --- a/intermediary-patches/@react-native-firebase+messaging+17.3.0.patch +++ /dev/null @@ -1,21 +0,0 @@ -diff --git a/node_modules/@react-native-firebase/messaging/android/src/main/java/io/invertase/firebase/messaging/ReactNativeFirebaseMessagingModule.java b/node_modules/@react-native-firebase/messaging/android/src/main/java/io/invertase/firebase/messaging/ReactNativeFirebaseMessagingModule.java -index 3b89817..057083a 100644 ---- a/node_modules/@react-native-firebase/messaging/android/src/main/java/io/invertase/firebase/messaging/ReactNativeFirebaseMessagingModule.java -+++ b/node_modules/@react-native-firebase/messaging/android/src/main/java/io/invertase/firebase/messaging/ReactNativeFirebaseMessagingModule.java -@@ -243,7 +243,15 @@ public class ReactNativeFirebaseMessagingModule extends ReactNativeFirebaseModul - @Override - public Map getConstants() { - final Map constants = new HashMap<>(); -- constants.put("isAutoInitEnabled", FirebaseMessaging.getInstance().isAutoInitEnabled()); -+ try { -+ constants.put("isAutoInitEnabled", FirebaseMessaging.getInstance().isAutoInitEnabled()); -+ } catch(Exception e) { -+ // Ignored on purpose -+ -+ // Ekrem: We had this patch for @10.1.0 version of this module. However, I'm not sure -+ // if we still need it after upgrading to @15.7.0. -+ } -+ - constants.put( - "isDeliveryMetricsExportToBigQueryEnabled", - FirebaseMessaging.getInstance().deliveryMetricsExportToBigQueryEnabled()); diff --git a/patches/apply-patches.js b/patches/apply-patches.js index 51d36a9ef..ced81bc10 100755 --- a/patches/apply-patches.js +++ b/patches/apply-patches.js @@ -7,10 +7,6 @@ const patchOperations = [ { dependency: "react-native-geocoder", patchFile: "react-native-geocoder+0.5.0.patch" - }, - { - dependency: "@react-native-firebase/app", - patchFile: "@react-native-firebase+messaging+17.3.0.patch" } ];