From 8cbe59fbf771df6ba932832c9d4fd17bf500ea91 Mon Sep 17 00:00:00 2001 From: Mike Hardy Date: Tue, 19 Nov 2024 13:47:55 -0500 Subject: [PATCH] feat(ios, sdk): allow FIREBASE_SDK_VERSION override This should make it easier for Expo folks to override the SDK when they need to --- docs/index.md | 2 ++ packages/app/RNFBApp.podspec | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/docs/index.md b/docs/index.md index c5f7c8285c..027c12042d 100644 --- a/docs/index.md +++ b/docs/index.md @@ -310,6 +310,8 @@ $FirebaseSDKVersion = '11.5.0' Once changed, reinstall your projects pods via pod install and rebuild your project with `npx react-native run-ios`. +Alternatively, if you cannot edit the Podfile easily (as when using Expo), you may add the environment variable `FIREBASE_SDK_VERSION=11.5.0` (or whatever version you need) to the command line that installs pods. For example `FIREBASE_SDK_VERSION=11.5.0 yarn expo prebuild --clean` + ### Increasing Android build memory As you add more Firebase modules, there is an incredible demand placed on the Android build system, and the default memory diff --git a/packages/app/RNFBApp.podspec b/packages/app/RNFBApp.podspec index 2a907161ed..d37d9e4b99 100644 --- a/packages/app/RNFBApp.podspec +++ b/packages/app/RNFBApp.podspec @@ -27,6 +27,11 @@ Pod::Spec.new do |s| # React Native dependencies s.dependency 'React-Core' + if (ENV.include?('FIREBASE_SDK_VERSION')) + Pod::UI.puts "#{s.name}: Found Firebase SDK version in environment '#{ENV['FIREBASE_SDK_VERSION']}'" + $FirebaseSDKVersion = ENV['FIREBASE_SDK_VERSION'] + end + if defined?($FirebaseSDKVersion) Pod::UI.puts "#{s.name}: Using user specified Firebase SDK version '#{$FirebaseSDKVersion}'" firebase_sdk_version = $FirebaseSDKVersion