@react-native-firebase/app 26.1.0 → 26.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/README.md +14 -0
- package/android/src/reactnative/java/io/invertase/firebase/app/ReactNativeFirebaseVersion.java +1 -1
- package/dist/module/version.js +1 -1
- package/dist/typescript/lib/version.d.ts +1 -1
- package/firebase_json.rb +11 -10
- package/firebase_spm.rb +186 -110
- package/ios/RNFBApp/RNFBVersion.m +1 -1
- package/lib/version.ts +1 -1
- package/package.json +5 -5
- package/plugin/build/index.d.ts +2 -1
- package/plugin/build/index.js +2 -1
- package/plugin/build/ios/index.d.ts +2 -1
- package/plugin/build/ios/index.js +3 -1
- package/plugin/build/ios/podfile.d.ts +4 -0
- package/plugin/build/ios/podfile.js +32 -0
- package/plugin/build/pluginConfig.d.ts +12 -0
- package/plugin/build/pluginConfig.js +2 -0
- package/plugin/src/index.ts +4 -2
- package/plugin/src/ios/index.ts +2 -1
- package/plugin/src/ios/podfile.ts +40 -0
- package/plugin/src/pluginConfig.ts +13 -0
- package/plugin/tsconfig.tsbuildinfo +1 -1
- package/ios/generated/RCTModuleProviders.h +0 -16
- package/ios/generated/RCTModuleProviders.mm +0 -52
- package/ios/generated/RCTUnstableModulesRequiringMainQueueSetupProvider.h +0 -14
- package/ios/generated/RCTUnstableModulesRequiringMainQueueSetupProvider.mm +0 -19
- package/ios/generated/ReactCodegen.podspec +0 -111
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,20 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [26.2.0](https://github.com/invertase/react-native-firebase/compare/v26.1.0...v26.2.0) (2026-08-10)
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
- **app, ios:** support disabling SPM via Expo config plugin ([9fbf0a0](https://github.com/invertase/react-native-firebase/commit/9fbf0a0f3f9cbdcc8a8f750aef9100775a7fd7e6))
|
|
11
|
+
|
|
12
|
+
### Bug Fixes
|
|
13
|
+
|
|
14
|
+
- **auth, ios:** match signInWithCustomToken selector to generated TurboModule spec ([#9146](https://github.com/invertase/react-native-firebase/issues/9146)) ([b674be7](https://github.com/invertase/react-native-firebase/commit/b674be7126f3e5a24cfdc1b0f70ab53cafcc8998))
|
|
15
|
+
- codegen should be wipe-then-regen ([04bc4e4](https://github.com/invertase/react-native-firebase/commit/04bc4e4cdab9870cb366fd212b2ccb331b0289d6))
|
|
16
|
+
- **ios:** link FirebaseCore into app target under SPM ([8d937c6](https://github.com/invertase/react-native-firebase/commit/8d937c61235cc51d0646885cb7da704365090ce8)), closes [#9158](https://github.com/invertase/react-native-firebase/issues/9158)
|
|
17
|
+
- **ios:** skip static frameworks in SPM archive embed phase ([#9155](https://github.com/invertase/react-native-firebase/issues/9155)) ([442f9d5](https://github.com/invertase/react-native-firebase/commit/442f9d563d07250a5c7b6e7ac5f305509210a8c7))
|
|
18
|
+
- results of running wipe-then-regen codegen ([1e008d1](https://github.com/invertase/react-native-firebase/commit/1e008d10b84ff2c1c1f1798c79b0bcc135bf620b))
|
|
19
|
+
|
|
6
20
|
## [26.1.0](https://github.com/invertase/react-native-firebase/compare/v26.0.0...v26.1.0) (2026-08-03)
|
|
7
21
|
|
|
8
22
|
### Features
|
package/README.md
CHANGED
|
@@ -51,6 +51,20 @@ To use CocoaPods instead, add this before any target block in your Podfile:
|
|
|
51
51
|
$RNFirebaseDisableSPM = true
|
|
52
52
|
```
|
|
53
53
|
|
|
54
|
+
Expo projects can set the same flag through the config plugin, which adds it
|
|
55
|
+
to the generated Podfile during prebuild:
|
|
56
|
+
|
|
57
|
+
```json
|
|
58
|
+
[
|
|
59
|
+
"@react-native-firebase/app",
|
|
60
|
+
{
|
|
61
|
+
"ios": {
|
|
62
|
+
"disableSPM": true
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
]
|
|
66
|
+
```
|
|
67
|
+
|
|
54
68
|
CocoaPods mode supports static or dynamic linkage. React Native versions older
|
|
55
69
|
than 0.75 fall back to CocoaPods automatically.
|
|
56
70
|
|
package/dist/module/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const version = "26.
|
|
1
|
+
export declare const version = "26.2.0";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/firebase_json.rb
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
+
# rubocop:disable Metrics, Style/Documentation, Style/GlobalVars
|
|
3
4
|
#
|
|
4
5
|
# Copyright (c) 2016-present Invertase Limited & Contributors
|
|
5
6
|
#
|
|
@@ -28,19 +29,17 @@ unless $firebase_json_path
|
|
|
28
29
|
|
|
29
30
|
is_test_project = false
|
|
30
31
|
|
|
31
|
-
if File.expand_path(current_search_directory).include? '/packages/app'
|
|
32
|
-
is_test_project = true
|
|
33
|
-
end
|
|
32
|
+
is_test_project = true if File.expand_path(current_search_directory).include? '/packages/app'
|
|
34
33
|
|
|
35
34
|
i = 0
|
|
36
35
|
while i < 5
|
|
37
36
|
current_search_directory = File.join(current_search_directory, '..')
|
|
38
37
|
|
|
39
|
-
if is_test_project
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
38
|
+
firebase_json = if is_test_project
|
|
39
|
+
File.expand_path(File.join(current_search_directory, 'tests', 'firebase.json'))
|
|
40
|
+
else
|
|
41
|
+
File.expand_path(File.join(current_search_directory, 'firebase.json'))
|
|
42
|
+
end
|
|
44
43
|
|
|
45
44
|
if File.exist?(firebase_json)
|
|
46
45
|
$firebase_json_path = firebase_json
|
|
@@ -48,9 +47,9 @@ unless $firebase_json_path
|
|
|
48
47
|
$firebase_json_config = JSON.parse(File.read(firebase_json))['react-native']
|
|
49
48
|
Pod::UI.puts "Using firebase.json from '#{firebase_json}'"
|
|
50
49
|
# Pod::UI.puts $firebase_json_config
|
|
51
|
-
rescue =>
|
|
50
|
+
rescue StandardError => e
|
|
52
51
|
Pod::UI.warn "An error occurred parsing the firebase.json located at '#{firebase_json}':"
|
|
53
|
-
Pod::UI.warn
|
|
52
|
+
Pod::UI.warn e
|
|
54
53
|
end
|
|
55
54
|
break
|
|
56
55
|
end
|
|
@@ -70,3 +69,5 @@ module FirebaseJSON
|
|
|
70
69
|
end
|
|
71
70
|
PATH = nil
|
|
72
71
|
end
|
|
72
|
+
|
|
73
|
+
# rubocop:enable Metrics, Style/Documentation, Style/GlobalVars
|
package/firebase_spm.rb
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
+
# rubocop:disable Metrics, Style/GlobalVars
|
|
3
4
|
#
|
|
4
5
|
# Copyright (c) 2016-present Invertase Limited & Contributors
|
|
5
6
|
#
|
|
@@ -19,7 +20,7 @@
|
|
|
19
20
|
require 'json'
|
|
20
21
|
|
|
21
22
|
RNFIREBASE_SPM_EMBED_PHASE_NAME = '[RNFB] Embed Firebase SPM Frameworks'
|
|
22
|
-
RNFIREBASE_SPM_SIGNATURE_FIX_PHASE_NAME = '[RNFB] Remove duplicate Firebase/Google SPM binary xcframework signature files'
|
|
23
|
+
RNFIREBASE_SPM_SIGNATURE_FIX_PHASE_NAME = '[RNFB] Remove duplicate Firebase/Google SPM binary xcframework signature files' # rubocop:disable Layout/LineLength
|
|
23
24
|
|
|
24
25
|
# Every `.binaryTarget` xcframework name reachable in the resolved SPM package
|
|
25
26
|
# graph for the RNFB test app (firebase-ios-sdk 12.16.0, full module set --
|
|
@@ -118,9 +119,7 @@ module RNFirebaseSPM
|
|
|
118
119
|
# by `activate!` above -- used by `rnfirebase_add_spm_core_to_app_target`
|
|
119
120
|
# to declare the same minimum version requirement on the app target's own
|
|
120
121
|
# FirebaseCore product dependency.
|
|
121
|
-
|
|
122
|
-
@version
|
|
123
|
-
end
|
|
122
|
+
attr_reader :version
|
|
124
123
|
|
|
125
124
|
# Clears active/version/url back to their unset defaults. Not needed in
|
|
126
125
|
# production Podfile code paths -- each `pod install` process is
|
|
@@ -149,10 +148,15 @@ end
|
|
|
149
148
|
# because static frameworks cause each pod to embed Firebase SPM products,
|
|
150
149
|
# resulting in duplicate symbol linker errors.
|
|
151
150
|
#
|
|
152
|
-
# firebase-ios-sdk SPM
|
|
153
|
-
#
|
|
151
|
+
# firebase-ios-sdk SPM products are plain `.library(...)` (automatic linkage),
|
|
152
|
+
# not `.library(type: .dynamic)`. See:
|
|
154
153
|
# https://github.com/firebase/firebase-ios-sdk/blob/main/Package.swift
|
|
155
|
-
#
|
|
154
|
+
# Automatic products are linked statically into each consumer. RNFB SPM mode
|
|
155
|
+
# therefore requires `use_frameworks! :linkage => :dynamic` so the app can
|
|
156
|
+
# build and run; static pod linkage collides those per-pod copies at link time.
|
|
157
|
+
# Dynamic pods avoid the link failure but still embed a private copy per pod,
|
|
158
|
+
# so third-party pods cannot share one FirebaseCore/FirebaseApp with RNFB
|
|
159
|
+
# under SPM (use `$RNFirebaseDisableSPM = true` + CocoaPods for that).
|
|
156
160
|
#
|
|
157
161
|
# Returns true only when `$RNFirebaseDisableSPM` has been explicitly set to `true`.
|
|
158
162
|
#
|
|
@@ -175,7 +179,7 @@ def rnfirebase_build_setting_list(current)
|
|
|
175
179
|
if current.nil? || (current.is_a?(String) && current.strip.empty?) || (current.is_a?(Array) && current.empty?)
|
|
176
180
|
['$(inherited)']
|
|
177
181
|
elsif current.is_a?(String)
|
|
178
|
-
current.split
|
|
182
|
+
current.split
|
|
179
183
|
else
|
|
180
184
|
current.dup
|
|
181
185
|
end
|
|
@@ -200,6 +204,28 @@ def rnfirebase_spm_embed_script
|
|
|
200
204
|
continue
|
|
201
205
|
fi
|
|
202
206
|
|
|
207
|
+
# Xcode's Archive action writes EVERY SKIP_INSTALL=YES product into
|
|
208
|
+
# ${OBJROOT}/UninstalledProducts/${PLATFORM_NAME} -- not just Swift
|
|
209
|
+
# Package products. With CocoaPods + `use_frameworks!` (required for
|
|
210
|
+
# SPM mode), that folder also contains every pod's .framework,
|
|
211
|
+
# including STATIC ones (Expo modules, the Pods_<target> umbrella,
|
|
212
|
+
# ...). Embedding a static framework into the app bundle makes App
|
|
213
|
+
# Store validation fail with "Invalid bundle structure ... binary
|
|
214
|
+
# file is not permitted". Only ever embed real dynamic libraries.
|
|
215
|
+
#
|
|
216
|
+
# Internal binary name matches the .framework folder name minus the
|
|
217
|
+
# extension for every CocoaPods/SPM-built framework (all this script
|
|
218
|
+
# handles).
|
|
219
|
+
binary_name="${framework_name%.framework}"
|
|
220
|
+
# Deliberate tradeoff: match `file -b` prose for "dynamically linked"
|
|
221
|
+
# rather than inspecting Mach-O magic bytes. Locale-independent in
|
|
222
|
+
# practice on Apple's `file`, but still a CLI string match.
|
|
223
|
+
if [ ! -f "${framework}/${binary_name}" ] || \
|
|
224
|
+
! file -b "${framework}/${binary_name}" | grep -q 'dynamically linked'; then
|
|
225
|
+
echo "Skipping ${framework_name}: binary missing or not dynamically linked"
|
|
226
|
+
continue
|
|
227
|
+
fi
|
|
228
|
+
|
|
203
229
|
echo "Embedding Firebase SPM framework ${framework_name} (from ${source_dir})"
|
|
204
230
|
rsync -av --delete \
|
|
205
231
|
--filter "- Headers" \
|
|
@@ -219,12 +245,16 @@ def rnfirebase_spm_embed_script
|
|
|
219
245
|
embed_frameworks_from "${BUILT_PRODUCTS_DIR}/PackageFrameworks"
|
|
220
246
|
|
|
221
247
|
# Xcode's Archive action (ONLY_ACTIVE_ARCH=NO, DEPLOYMENT_POSTPROCESSING=YES)
|
|
222
|
-
# never populates
|
|
223
|
-
#
|
|
224
|
-
# folder
|
|
225
|
-
#
|
|
226
|
-
#
|
|
227
|
-
#
|
|
248
|
+
# never populates PackageFrameworks. It stages build products under
|
|
249
|
+
# ${OBJROOT}/UninstalledProducts/${PLATFORM_NAME} instead -- and that
|
|
250
|
+
# folder is NOT SPM-only: Archive writes every SKIP_INSTALL=YES product
|
|
251
|
+
# there, which under CocoaPods + use_frameworks! (required for SPM mode)
|
|
252
|
+
# includes every pod .framework (dynamic Firebase SPM products and static
|
|
253
|
+
# pods alike). Without this fallback, Archive embeds zero Firebase SPM
|
|
254
|
+
# frameworks and the app crashes at launch (missing-library dyld). The
|
|
255
|
+
# filter inside embed_frameworks_from keeps only dynamically linked
|
|
256
|
+
# binaries so static CocoaPods frameworks are not copied into the app
|
|
257
|
+
# bundle (App Store "Invalid bundle structure").
|
|
228
258
|
embed_frameworks_from "${OBJROOT}/UninstalledProducts/${PLATFORM_NAME}"
|
|
229
259
|
SCRIPT
|
|
230
260
|
end
|
|
@@ -250,8 +280,8 @@ def rnfirebase_upsert_shell_script_phase!(target, name, shell_script:, shell_pat
|
|
|
250
280
|
changed ||= phase.shell_script != shell_script
|
|
251
281
|
changed ||= phase.shell_path != shell_path
|
|
252
282
|
changed ||= phase.always_out_of_date != '1'
|
|
253
|
-
changed ||=
|
|
254
|
-
changed ||=
|
|
283
|
+
changed ||= !input_paths.nil? && phase.input_paths != input_paths
|
|
284
|
+
changed ||= !output_paths.nil? && phase.output_paths != output_paths
|
|
255
285
|
|
|
256
286
|
phase.shell_script = shell_script
|
|
257
287
|
phase.shell_path = shell_path
|
|
@@ -356,7 +386,7 @@ def rnfirebase_verify_spm_embed_phase_applied!(installer)
|
|
|
356
386
|
|
|
357
387
|
Without it, this app will crash at launch with a missing-library dyld error, because Firebase's Swift Package frameworks never get copied into the app bundle.
|
|
358
388
|
|
|
359
|
-
Add `rnfirebase_add_spm_embed_phase(installer)` to your Podfile's post_install block as a fallback, then run `pod install` again.
|
|
389
|
+
Add `rnfirebase_add_spm_embed_phase(installer)` to your Podfile's post_install block as a fallback, then run `pod install` again. # rubocop:disable Layout/LineLength
|
|
360
390
|
MESSAGE
|
|
361
391
|
end
|
|
362
392
|
|
|
@@ -366,14 +396,16 @@ end
|
|
|
366
396
|
# architecture ..." linker error later, at Xcode build time, with no obvious
|
|
367
397
|
# link back to the Podfile setting that caused it.
|
|
368
398
|
#
|
|
369
|
-
# firebase-ios-sdk's SPM
|
|
370
|
-
#
|
|
371
|
-
#
|
|
372
|
-
#
|
|
373
|
-
#
|
|
374
|
-
#
|
|
375
|
-
#
|
|
376
|
-
#
|
|
399
|
+
# firebase-ios-sdk's SPM products are automatic libraries (plain `.library(...)`,
|
|
400
|
+
# not `type: .dynamic`) -- see
|
|
401
|
+
# https://github.com/firebase/firebase-ios-sdk/blob/main/Package.swift -- so
|
|
402
|
+
# each pod that resolves Firebase via SPM statically embeds its own copy.
|
|
403
|
+
# Under static pod linkage those copies collide when the app links
|
|
404
|
+
# (`duplicate symbol`). Under dynamic pod linkage the app builds, but each
|
|
405
|
+
# dynamic framework still keeps a private copy (runtime class duplication /
|
|
406
|
+
# split FirebaseApp registries). There is no supported combination of RNFB's
|
|
407
|
+
# SPM mode with static linkage; the fix is always to switch to dynamic
|
|
408
|
+
# linkage or opt out of SPM entirely.
|
|
377
409
|
#
|
|
378
410
|
# Raises `Pod::Informative` -- CocoaPods' own user-facing error class, which
|
|
379
411
|
# `pod install` prints as a plain, readable message with no Ruby backtrace --
|
|
@@ -404,7 +436,7 @@ def rnfirebase_fail_if_spm_static_linkage!(installer)
|
|
|
404
436
|
raise Pod::Informative, <<~MESSAGE
|
|
405
437
|
[react-native-firebase] SPM + static linkage is not supported (target(s): #{target_names}).
|
|
406
438
|
|
|
407
|
-
firebase-ios-sdk's Swift Package
|
|
439
|
+
firebase-ios-sdk's Swift Package products are automatic libraries (not `type: .dynamic`), so each react-native-firebase pod that resolves Firebase via SPM embeds its own copy. With `use_frameworks! :linkage => :static` those copies collide at link time as duplicate-symbol errors.
|
|
408
440
|
|
|
409
441
|
Fix one of the following in your Podfile, then run `pod install` again:
|
|
410
442
|
- Use dynamic linkage: `use_frameworks! :linkage => :dynamic`
|
|
@@ -437,24 +469,23 @@ def rnfirebase_ensure_pods_uuid_counter_safe!(installer)
|
|
|
437
469
|
idx = uuid[6, 7].to_i(16)
|
|
438
470
|
max_idx = idx if idx > max_idx
|
|
439
471
|
end
|
|
440
|
-
return if max_idx
|
|
472
|
+
return if max_idx.negative?
|
|
441
473
|
|
|
442
474
|
generated = project.instance_variable_get(:@generated_uuids)
|
|
443
475
|
generated = [] unless generated.is_a?(Array)
|
|
444
476
|
already_high = generated.size > max_idx
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
end
|
|
477
|
+
# CocoaPods UUID layout (prefix + 7 hex digits + trailing 0) — positional tokens are intentional.
|
|
478
|
+
generated << format('%.6s%07X0', prefix, generated.size) while generated.size <= max_idx # rubocop:disable Style/FormatStringToken
|
|
448
479
|
project.instance_variable_set(:@generated_uuids, generated)
|
|
449
480
|
project.instance_variable_set(:@available_uuids, [])
|
|
450
481
|
|
|
451
482
|
# Only log when SPM is active and we actually padded -- non-SPM installs
|
|
452
483
|
# still get the counter raise (cheap insurance) but must not spam every
|
|
453
484
|
# `pod install` with a success line.
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
485
|
+
return unless !already_high && defined?(Pod::UI) && RNFirebaseSPM.active?
|
|
486
|
+
|
|
487
|
+
Pod::UI.puts '[react-native-firebase] Raised CocoaPods Pods UUID counter ' \
|
|
488
|
+
"past index #{max_idx} before RN SPM mutates Pods.xcodeproj."
|
|
458
489
|
end
|
|
459
490
|
|
|
460
491
|
# Hard integrity check for the UUID-collision failure class above -- mirrors
|
|
@@ -479,7 +510,6 @@ def rnfirebase_verify_pods_project_uuid_integrity!(installer)
|
|
|
479
510
|
root = project.root_object
|
|
480
511
|
resolved = root && project.objects_by_uuid[root.uuid]
|
|
481
512
|
return if root &&
|
|
482
|
-
resolved &&
|
|
483
513
|
resolved.equal?(root) &&
|
|
484
514
|
resolved.respond_to?(:isa) &&
|
|
485
515
|
resolved.isa == 'PBXProject'
|
|
@@ -532,8 +562,8 @@ def rnfirebase_hook_cocoapods_post_install!(installer_class = (Pod::Installer if
|
|
|
532
562
|
unless installer_class
|
|
533
563
|
if defined?(Pod::UI)
|
|
534
564
|
Pod::UI.warn '[react-native-firebase] `Pod::Installer` isn\'t defined -- automatic Firebase SPM setup ' \
|
|
535
|
-
|
|
536
|
-
|
|
565
|
+
'(dynamic framework embedding, etc.) was not hooked into `pod install`. Add ' \
|
|
566
|
+
'`rnfirebase_add_spm_embed_phase(installer)` to your Podfile\'s post_install block as a fallback.'
|
|
537
567
|
end
|
|
538
568
|
return
|
|
539
569
|
end
|
|
@@ -542,9 +572,9 @@ def rnfirebase_hook_cocoapods_post_install!(installer_class = (Pod::Installer if
|
|
|
542
572
|
unless was_private || installer_class.method_defined?(hook_method)
|
|
543
573
|
if defined?(Pod::UI)
|
|
544
574
|
Pod::UI.warn "[react-native-firebase] `Pod::Installer##{hook_method}` doesn't exist (a CocoaPods " \
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
575
|
+
'release may have renamed or removed it) -- automatic Firebase SPM setup was not hooked into ' \
|
|
576
|
+
'`pod install`. Add `rnfirebase_add_spm_embed_phase(installer)` to your Podfile\'s post_install ' \
|
|
577
|
+
'block as a fallback.'
|
|
548
578
|
end
|
|
549
579
|
return
|
|
550
580
|
end
|
|
@@ -572,12 +602,12 @@ def rnfirebase_hook_cocoapods_post_install!(installer_class = (Pod::Installer if
|
|
|
572
602
|
# post_install, same pattern as embed-phase add + verify below.
|
|
573
603
|
begin
|
|
574
604
|
rnfirebase_ensure_pods_uuid_counter_safe!(self)
|
|
575
|
-
rescue => e
|
|
605
|
+
rescue StandardError => e
|
|
576
606
|
if defined?(Pod::UI)
|
|
577
607
|
Pod::UI.warn '[react-native-firebase] Couldn\'t raise Pods UUID counter before ' \
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
608
|
+
"RN SPM (#{e.class}: #{e.message}). If `pod install` leaves Pods.xcodeproj " \
|
|
609
|
+
'damaged (missing PBXProject / Xcode `_setSavedArchiveVersion`), upgrade ' \
|
|
610
|
+
'react-native-firebase or patch CocoaPods UUID generation.'
|
|
581
611
|
end
|
|
582
612
|
end
|
|
583
613
|
result = send(original_method)
|
|
@@ -586,11 +616,11 @@ def rnfirebase_hook_cocoapods_post_install!(installer_class = (Pod::Installer if
|
|
|
586
616
|
rnfirebase_verify_pods_project_uuid_integrity!(self)
|
|
587
617
|
begin
|
|
588
618
|
rnfirebase_add_spm_embed_phase(self)
|
|
589
|
-
rescue => e
|
|
619
|
+
rescue StandardError => e
|
|
590
620
|
if defined?(Pod::UI)
|
|
591
621
|
Pod::UI.warn "[react-native-firebase] Couldn't embed Firebase SPM frameworks " \
|
|
592
|
-
|
|
593
|
-
|
|
622
|
+
"automatically (#{e.class}: #{e.message}). Add `rnfirebase_add_spm_embed_phase(installer)` " \
|
|
623
|
+
'to your Podfile\'s post_install block as a fallback.'
|
|
594
624
|
end
|
|
595
625
|
end
|
|
596
626
|
# Deliberately outside the `rescue` above, and not itself wrapped in a
|
|
@@ -606,56 +636,58 @@ def rnfirebase_hook_cocoapods_post_install!(installer_class = (Pod::Installer if
|
|
|
606
636
|
rnfirebase_verify_spm_embed_phase_applied!(self)
|
|
607
637
|
begin
|
|
608
638
|
rnfirebase_add_spm_core_to_app_target(self)
|
|
609
|
-
rescue => e
|
|
639
|
+
rescue StandardError => e
|
|
610
640
|
if defined?(Pod::UI)
|
|
611
641
|
Pod::UI.warn "[react-native-firebase] Couldn't link FirebaseCore into the app target " \
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
642
|
+
"automatically (#{e.class}: #{e.message}). " \
|
|
643
|
+
'Add `rnfirebase_add_spm_core_to_app_target(installer)` ' \
|
|
644
|
+
'to your Podfile\'s post_install block as a fallback if your own native code calls ' \
|
|
645
|
+
'FIRApp/FIROptions APIs directly.'
|
|
615
646
|
end
|
|
616
647
|
end
|
|
617
648
|
begin
|
|
618
649
|
rnfirebase_remove_spm_core_from_app_target(self)
|
|
619
|
-
rescue => e
|
|
650
|
+
rescue StandardError => e
|
|
620
651
|
if defined?(Pod::UI)
|
|
621
652
|
Pod::UI.warn "[react-native-firebase] Couldn't remove a stale FirebaseCore SPM link from the " \
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
653
|
+
"app target automatically (#{e.class}: #{e.message}). If you previously used SPM and have " \
|
|
654
|
+
'since set `$RNFirebaseDisableSPM = true`, remove the "firebase-ios-sdk" Swift Package ' \
|
|
655
|
+
'dependency from your app target manually in Xcode.'
|
|
625
656
|
end
|
|
626
657
|
end
|
|
627
658
|
begin
|
|
628
659
|
rnfirebase_fix_spm_archive_signature_collision(self)
|
|
629
|
-
rescue => e
|
|
660
|
+
rescue StandardError => e
|
|
630
661
|
if defined?(Pod::UI)
|
|
631
662
|
Pod::UI.warn '[react-native-firebase] Couldn\'t add the Firebase/Google SPM binary ' \
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
663
|
+
"xcframework signature workaround automatically (#{e.class}: #{e.message}). If your " \
|
|
664
|
+
'Release archive fails with `"...xcframework-ios.signature" couldn\'t be copied to ' \
|
|
665
|
+
'"Signatures" because an item with the same name already exists`, add a Run Script ' \
|
|
666
|
+
'build phase to your app target that runs `rm -f ' \
|
|
667
|
+
'"\\${CONFIGURATION_BUILD_DIR}"/<TheNameFromTheErrorMessage>.xcframework-ios.signature`.'
|
|
637
668
|
end
|
|
638
669
|
end
|
|
639
670
|
begin
|
|
640
671
|
rnfirebase_apply_spm_build_settings(self)
|
|
641
|
-
rescue => e
|
|
672
|
+
rescue StandardError => e
|
|
642
673
|
if defined?(Pod::UI)
|
|
643
674
|
Pod::UI.warn "[react-native-firebase] Couldn't apply Firebase SPM build settings " \
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
675
|
+
"automatically (#{e.class}: #{e.message}). " \
|
|
676
|
+
'Add `rnfirebase_apply_spm_build_settings(installer)` ' \
|
|
677
|
+
'to your Podfile\'s post_install block as a fallback if Release builds crash at launch with ' \
|
|
678
|
+
'missing FIRComponent registrations, or Xcode reports that a Firebase module such as ' \
|
|
679
|
+
'`FirebaseCoreInternal`/`FirebaseSharedSwift` cannot be resolved.'
|
|
648
680
|
end
|
|
649
681
|
end
|
|
650
682
|
result
|
|
651
683
|
end
|
|
652
684
|
end
|
|
653
685
|
installer_class.send(:private, hook_method) if was_private
|
|
654
|
-
rescue => e
|
|
686
|
+
rescue StandardError => e
|
|
655
687
|
if defined?(Pod::UI)
|
|
656
688
|
Pod::UI.warn "[react-native-firebase] Couldn't hook CocoaPods to auto-embed Firebase SPM " \
|
|
657
|
-
|
|
658
|
-
|
|
689
|
+
"frameworks (#{e.class}: #{e.message}). Add `rnfirebase_add_spm_embed_phase(installer)` " \
|
|
690
|
+
'to your Podfile\'s post_install block as a fallback.'
|
|
659
691
|
end
|
|
660
692
|
end
|
|
661
693
|
|
|
@@ -694,28 +726,67 @@ def rnfirebase_add_spm_core_to_app_target(installer)
|
|
|
694
726
|
next unless target.respond_to?(:package_product_dependencies)
|
|
695
727
|
next unless target.respond_to?(:shell_script_build_phases)
|
|
696
728
|
next unless target.shell_script_build_phases.any? { |phase| phase.name == '[CP] Embed Pods Frameworks' }
|
|
697
|
-
next if target.package_product_dependencies.any? { |dep| dep.product_name == 'FirebaseCore' }
|
|
698
729
|
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
730
|
+
# A `FirebaseCore` product dependency already being declared on the
|
|
731
|
+
# target does *not* by itself mean this target is a genuine no-op:
|
|
732
|
+
# a pre-fix RNFB version could have committed that dependency into
|
|
733
|
+
# the consumer's `.pbxproj` without ever linking it (see the
|
|
734
|
+
# PBXBuildFile comment below) -- that's the exact broken state #9158
|
|
735
|
+
# reports, and it's already sitting in every affected consumer's
|
|
736
|
+
# project today. So checking `package_product_dependencies` alone
|
|
737
|
+
# can't tell that already-affected state apart from a healthy,
|
|
738
|
+
# already-linked one -- it has to check the build phase itself.
|
|
739
|
+
existing_ref = target.package_product_dependencies.find { |dep| dep.product_name == 'FirebaseCore' }
|
|
740
|
+
if existing_ref
|
|
741
|
+
next if target.frameworks_build_phase.files.any? { |bf| bf.product_ref == existing_ref }
|
|
742
|
+
|
|
743
|
+
# Healing path: reuse the dependency (and its package reference)
|
|
744
|
+
# that's already declared -- only the link (PBXBuildFile) is
|
|
745
|
+
# missing, so don't create a duplicate dependency/package reference.
|
|
746
|
+
ref = existing_ref
|
|
747
|
+
else
|
|
748
|
+
pkg = project.root_object.package_references.find do |candidate|
|
|
749
|
+
candidate.instance_of?(pkg_class) && candidate.repositoryURL == RNFirebaseSPM.url
|
|
750
|
+
end
|
|
751
|
+
unless pkg
|
|
752
|
+
pkg = project.new(pkg_class)
|
|
753
|
+
pkg.repositoryURL = RNFirebaseSPM.url
|
|
754
|
+
pkg.requirement = { kind: 'upToNextMajorVersion', minimumVersion: RNFirebaseSPM.version }
|
|
755
|
+
project.root_object.package_references << pkg
|
|
756
|
+
end
|
|
757
|
+
|
|
758
|
+
ref = project.new(ref_class)
|
|
759
|
+
ref.package = pkg
|
|
760
|
+
ref.product_name = 'FirebaseCore'
|
|
761
|
+
target.package_product_dependencies << ref
|
|
707
762
|
end
|
|
708
763
|
|
|
709
|
-
if defined?(Pod
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
764
|
+
if defined?(Pod::UI)
|
|
765
|
+
message = if existing_ref
|
|
766
|
+
'Repairing FirebaseCore SPM link on the app target (dependency was already declared but ' \
|
|
767
|
+
'never linked) so native code that calls FIRApp/FIROptions APIs directly can resolve ' \
|
|
768
|
+
'those symbols.'
|
|
769
|
+
else
|
|
770
|
+
'Linking FirebaseCore directly into the app target (SPM) so native code that calls ' \
|
|
771
|
+
'FIRApp/FIROptions APIs directly can resolve those symbols.'
|
|
772
|
+
end
|
|
773
|
+
Pod::UI.puts "[react-native-firebase] #{target.name}: ".yellow + message
|
|
713
774
|
end
|
|
714
775
|
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
776
|
+
# Declaring the product dependency (above, or in a prior install for
|
|
777
|
+
# the healing path) only tells Xcode the target *depends* on it -- it
|
|
778
|
+
# doesn't actually link it. Linking a package product (same as
|
|
779
|
+
# CocoaPods pod dependencies, and the same as adding
|
|
780
|
+
# one via Xcode's own "Frameworks, Libraries, and Embedded Content" UI)
|
|
781
|
+
# requires a matching PBXBuildFile, with its product_ref pointed at
|
|
782
|
+
# this same dependency, in the target's Frameworks build phase. Without
|
|
783
|
+
# this, the app fails at the link step with "Undefined symbols ...
|
|
784
|
+
# _OBJC_CLASS_$_FIRApp" for any native code that calls FIRApp/FIROptions
|
|
785
|
+
# directly (e.g. Expo's generated AppDelegate) -- even though `pod
|
|
786
|
+
# install` itself appears to succeed.
|
|
787
|
+
build_file = project.new(Xcodeproj::Project::Object::PBXBuildFile)
|
|
788
|
+
build_file.product_ref = ref
|
|
789
|
+
target.frameworks_build_phase.files << build_file
|
|
719
790
|
|
|
720
791
|
target.build_configurations.each do |config|
|
|
721
792
|
build_settings = target.build_settings(config.name)
|
|
@@ -778,31 +849,35 @@ def rnfirebase_remove_spm_core_from_app_target(installer)
|
|
|
778
849
|
next unless target.respond_to?(:package_product_dependencies)
|
|
779
850
|
|
|
780
851
|
stale_refs = target.package_product_dependencies.select do |dep|
|
|
781
|
-
dep.
|
|
852
|
+
dep.instance_of?(ref_class) && dep.product_name == 'FirebaseCore' && dep.package&.repositoryURL == RNFirebaseSPM.url # rubocop:disable Layout/LineLength
|
|
782
853
|
end
|
|
783
854
|
next if stale_refs.empty?
|
|
784
855
|
|
|
785
|
-
if defined?(Pod
|
|
786
|
-
Pod::UI.puts "[react-native-firebase] #{target.name}: ".yellow
|
|
787
|
-
'SPM disabled -- removing the stale FirebaseCore Swift Package link left on the app target.'
|
|
856
|
+
if defined?(Pod::UI)
|
|
857
|
+
Pod::UI.puts "#{"[react-native-firebase] #{target.name}: ".yellow}SPM disabled -- removing the stale FirebaseCore Swift Package link left on the app target." # rubocop:disable Layout/LineLength
|
|
788
858
|
end
|
|
789
859
|
|
|
790
860
|
stale_refs.each do |ref|
|
|
791
861
|
target.package_product_dependencies.delete(ref)
|
|
862
|
+
# `ref.remove_from_project` below only nils out the matching PBXBuildFile's
|
|
863
|
+
# product_ref -- it doesn't remove the now-empty PBXBuildFile itself from the
|
|
864
|
+
# Frameworks build phase -- so look it up first, while product_ref is still set.
|
|
865
|
+
stale_build_file = target.frameworks_build_phase.files.find { |file| file.product_ref == ref }
|
|
866
|
+
target.frameworks_build_phase.files.delete(stale_build_file) if stale_build_file
|
|
792
867
|
ref.remove_from_project
|
|
793
868
|
end
|
|
794
869
|
project_modified = true
|
|
795
870
|
end
|
|
796
871
|
|
|
797
872
|
project.root_object.package_references
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
873
|
+
.select { |pkg| pkg.instance_of?(pkg_class) && pkg.repositoryURL == RNFirebaseSPM.url }
|
|
874
|
+
.each do |pkg|
|
|
875
|
+
next if pkg.referrers.any?(ref_class)
|
|
801
876
|
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
877
|
+
project.root_object.package_references.delete(pkg)
|
|
878
|
+
pkg.remove_from_project
|
|
879
|
+
project_modified = true
|
|
880
|
+
end
|
|
806
881
|
|
|
807
882
|
project.save if project_modified
|
|
808
883
|
end
|
|
@@ -857,9 +932,11 @@ def rnfirebase_fix_spm_archive_signature_collision(installer)
|
|
|
857
932
|
next unless target.respond_to?(:shell_script_build_phases)
|
|
858
933
|
next unless target.shell_script_build_phases.any? { |phase| phase.name == '[CP] Embed Pods Frameworks' }
|
|
859
934
|
|
|
860
|
-
|
|
935
|
+
rm_lines = RNFIREBASE_SPM_SIGNATURE_FIX_ARTIFACT_NAMES.map do |name|
|
|
861
936
|
"rm -f \"${CONFIGURATION_BUILD_DIR}\"/#{name}.xcframework-ios.signature"
|
|
862
|
-
|
|
937
|
+
end
|
|
938
|
+
# Trailing newline required for Xcode Run Script phase content.
|
|
939
|
+
shell_script = "#{rm_lines.join("\n")}\n"
|
|
863
940
|
|
|
864
941
|
changed = rnfirebase_upsert_shell_script_phase!(
|
|
865
942
|
target,
|
|
@@ -989,23 +1066,20 @@ def firebase_dependency(spec, version, spm_products, pods)
|
|
|
989
1066
|
# dependency list) so `rnfirebase_add_spm_embed_phase` doesn't depend on
|
|
990
1067
|
# any RN-internal state shape -- only on whether *we* ever took this path.
|
|
991
1068
|
RNFirebaseSPM.activate!(version)
|
|
992
|
-
if defined?(Pod
|
|
1069
|
+
if defined?(Pod::UI)
|
|
993
1070
|
Pod::UI.puts "[react-native-firebase] #{spec.name}: ".yellow +
|
|
994
|
-
|
|
1071
|
+
"Using SPM for Firebase dependency resolution (products: #{spm_products.join(', ')})"
|
|
995
1072
|
end
|
|
996
1073
|
spm_dependency(spec,
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
)
|
|
1074
|
+
url: RNFirebaseSPM.url,
|
|
1075
|
+
requirement: { kind: 'upToNextMajorVersion', minimumVersion: version },
|
|
1076
|
+
products: spm_products)
|
|
1001
1077
|
else
|
|
1002
|
-
if defined?(Pod
|
|
1078
|
+
if defined?(Pod::UI)
|
|
1003
1079
|
if rnfirebase_spm_disabled?
|
|
1004
|
-
Pod::UI.puts "[react-native-firebase] #{spec.name}: ".yellow
|
|
1005
|
-
"SPM disabled ($RNFirebaseDisableSPM = true), using CocoaPods for Firebase dependencies"
|
|
1080
|
+
Pod::UI.puts "#{"[react-native-firebase] #{spec.name}: ".yellow}SPM disabled ($RNFirebaseDisableSPM = true), using CocoaPods for Firebase dependencies" # rubocop:disable Layout/LineLength
|
|
1006
1081
|
elsif !defined?(spm_dependency)
|
|
1007
|
-
Pod::UI.puts "[react-native-firebase] #{spec.name}: ".yellow
|
|
1008
|
-
"SPM not available (React Native < 0.75), using CocoaPods for Firebase dependencies"
|
|
1082
|
+
Pod::UI.puts "#{"[react-native-firebase] #{spec.name}: ".yellow}SPM not available (React Native < 0.75), using CocoaPods for Firebase dependencies" # rubocop:disable Layout/LineLength
|
|
1009
1083
|
end
|
|
1010
1084
|
end
|
|
1011
1085
|
pods = [pods] unless pods.is_a?(Array)
|
|
@@ -1014,3 +1088,5 @@ def firebase_dependency(spec, version, spm_products, pods)
|
|
|
1014
1088
|
end
|
|
1015
1089
|
end
|
|
1016
1090
|
end
|
|
1091
|
+
|
|
1092
|
+
# rubocop:enable Metrics, Style/GlobalVars
|
package/lib/version.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// Generated by genversion.
|
|
2
|
-
export const version = '26.
|
|
2
|
+
export const version = '26.2.0';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-native-firebase/app",
|
|
3
|
-
"version": "26.
|
|
3
|
+
"version": "26.2.0",
|
|
4
4
|
"author": "Invertase <oss@invertase.io> (http://invertase.io)",
|
|
5
5
|
"description": "A well tested, feature rich Firebase implementation for React Native, supporting iOS & Android. Individual module support for Admob, Analytics, Auth, Crash Reporting, Cloud Firestore, Database, Dynamic Links, Functions, Messaging (FCM), Remote Config, Storage and more.",
|
|
6
6
|
"main": "./dist/module/index.js",
|
|
@@ -22,8 +22,8 @@
|
|
|
22
22
|
},
|
|
23
23
|
"scripts": {
|
|
24
24
|
"codegen": "yarn android:codegen && yarn ios:codegen",
|
|
25
|
-
"android:codegen": "npx @react-native-community/cli codegen --platform android --outputPath=./android/src/reactnative/java/io/invertase/firebase/app/generated",
|
|
26
|
-
"ios:codegen": "npx @react-native-community/cli codegen --platform ios --outputPath=./ios/generated",
|
|
25
|
+
"android:codegen": "rimraf android/src/reactnative/java/io/invertase/firebase/app/generated && npx @react-native-community/cli codegen --platform android --outputPath=./android/src/reactnative/java/io/invertase/firebase/app/generated",
|
|
26
|
+
"ios:codegen": "rimraf ios/generated && npx @react-native-community/cli codegen --platform ios --outputPath=./ios/generated",
|
|
27
27
|
"build": "genversion --esm --semi lib/version.ts && npm run build:version",
|
|
28
28
|
"build:version": "node ./scripts/genversion-ios && node ./scripts/genversion-android",
|
|
29
29
|
"build:clean": "rimraf android/build && rimraf ios/build",
|
|
@@ -115,7 +115,7 @@
|
|
|
115
115
|
"firebase": "12.17.0"
|
|
116
116
|
},
|
|
117
117
|
"devDependencies": {
|
|
118
|
-
"@react-native-async-storage/async-storage": "^
|
|
118
|
+
"@react-native-async-storage/async-storage": "^3.1.1",
|
|
119
119
|
"expo": "^55.0.18",
|
|
120
120
|
"react-native-builder-bob": "^0.41.0"
|
|
121
121
|
},
|
|
@@ -184,5 +184,5 @@
|
|
|
184
184
|
}
|
|
185
185
|
}
|
|
186
186
|
},
|
|
187
|
-
"gitHead": "
|
|
187
|
+
"gitHead": "b7efa8ca2781b5102975ee5169ee6fc52e9c1588"
|
|
188
188
|
}
|
package/plugin/build/index.d.ts
CHANGED
package/plugin/build/index.js
CHANGED
|
@@ -6,11 +6,12 @@ const ios_1 = require("./ios");
|
|
|
6
6
|
/**
|
|
7
7
|
* A config plugin for configuring `@react-native-firebase/app`
|
|
8
8
|
*/
|
|
9
|
-
const withRnFirebaseApp = config => {
|
|
9
|
+
const withRnFirebaseApp = (config, props) => {
|
|
10
10
|
return (0, config_plugins_1.withPlugins)(config, [
|
|
11
11
|
// iOS
|
|
12
12
|
ios_1.withFirebaseAppDelegate,
|
|
13
13
|
ios_1.withIosGoogleServicesFile,
|
|
14
|
+
[ios_1.withIosDisableSPM, props],
|
|
14
15
|
// Android
|
|
15
16
|
android_1.withBuildscriptDependency,
|
|
16
17
|
android_1.withApplyGoogleServicesPlugin,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import { withFirebaseAppDelegate } from './appDelegate';
|
|
2
2
|
import { withIosGoogleServicesFile } from './googleServicesPlist';
|
|
3
|
-
|
|
3
|
+
import { withIosDisableSPM } from './podfile';
|
|
4
|
+
export { withIosGoogleServicesFile, withFirebaseAppDelegate, withIosDisableSPM };
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.withFirebaseAppDelegate = exports.withIosGoogleServicesFile = void 0;
|
|
3
|
+
exports.withIosDisableSPM = exports.withFirebaseAppDelegate = exports.withIosGoogleServicesFile = void 0;
|
|
4
4
|
const appDelegate_1 = require("./appDelegate");
|
|
5
5
|
Object.defineProperty(exports, "withFirebaseAppDelegate", { enumerable: true, get: function () { return appDelegate_1.withFirebaseAppDelegate; } });
|
|
6
6
|
const googleServicesPlist_1 = require("./googleServicesPlist");
|
|
7
7
|
Object.defineProperty(exports, "withIosGoogleServicesFile", { enumerable: true, get: function () { return googleServicesPlist_1.withIosGoogleServicesFile; } });
|
|
8
|
+
const podfile_1 = require("./podfile");
|
|
9
|
+
Object.defineProperty(exports, "withIosDisableSPM", { enumerable: true, get: function () { return podfile_1.withIosDisableSPM; } });
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.withIosDisableSPM = void 0;
|
|
4
|
+
exports.setAppPodfileDisableSPM = setAppPodfileDisableSPM;
|
|
5
|
+
const config_plugins_1 = require("@expo/config-plugins");
|
|
6
|
+
const generateCode_1 = require("@expo/config-plugins/build/utils/generateCode");
|
|
7
|
+
const TAG = '@react-native-firebase/app-disableSPM';
|
|
8
|
+
const ANCHOR = /prepare_react_native_project!/;
|
|
9
|
+
const FLAG = '$RNFirebaseDisableSPM = true';
|
|
10
|
+
// The flag must be defined before any target block so firebase_spm.rb sees it
|
|
11
|
+
// when pods are declared - anchoring just after `prepare_react_native_project!`
|
|
12
|
+
// guarantees that in the Podfile Expo generates.
|
|
13
|
+
function setAppPodfileDisableSPM(src, enabled = false) {
|
|
14
|
+
if (!enabled) {
|
|
15
|
+
return (0, generateCode_1.removeGeneratedContents)(src, TAG) ?? src;
|
|
16
|
+
}
|
|
17
|
+
return (0, generateCode_1.mergeContents)({
|
|
18
|
+
src,
|
|
19
|
+
newSrc: FLAG,
|
|
20
|
+
tag: TAG,
|
|
21
|
+
anchor: ANCHOR,
|
|
22
|
+
offset: 1,
|
|
23
|
+
comment: '#',
|
|
24
|
+
}).contents;
|
|
25
|
+
}
|
|
26
|
+
const withIosDisableSPM = (config, props) => {
|
|
27
|
+
return (0, config_plugins_1.withPodfile)(config, config => {
|
|
28
|
+
config.modResults.contents = setAppPodfileDisableSPM(config.modResults.contents, props?.ios?.disableSPM === true);
|
|
29
|
+
return config;
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
exports.withIosDisableSPM = withIosDisableSPM;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface PluginConfigType {
|
|
2
|
+
ios?: PluginConfigTypeIos;
|
|
3
|
+
}
|
|
4
|
+
export interface PluginConfigTypeIos {
|
|
5
|
+
/**
|
|
6
|
+
* Sets `$RNFirebaseDisableSPM = true` in the Podfile, forcing Firebase
|
|
7
|
+
* dependencies to be installed with CocoaPods instead of Swift Package Manager.
|
|
8
|
+
*
|
|
9
|
+
* @platform ios iOS
|
|
10
|
+
*/
|
|
11
|
+
disableSPM?: boolean;
|
|
12
|
+
}
|
package/plugin/src/index.ts
CHANGED
|
@@ -5,16 +5,18 @@ import {
|
|
|
5
5
|
withBuildscriptDependency,
|
|
6
6
|
withCopyAndroidGoogleServices,
|
|
7
7
|
} from './android';
|
|
8
|
-
import { withFirebaseAppDelegate, withIosGoogleServicesFile } from './ios';
|
|
8
|
+
import { withFirebaseAppDelegate, withIosGoogleServicesFile, withIosDisableSPM } from './ios';
|
|
9
|
+
import { PluginConfigType } from './pluginConfig';
|
|
9
10
|
|
|
10
11
|
/**
|
|
11
12
|
* A config plugin for configuring `@react-native-firebase/app`
|
|
12
13
|
*/
|
|
13
|
-
const withRnFirebaseApp: ConfigPlugin = config => {
|
|
14
|
+
const withRnFirebaseApp: ConfigPlugin<PluginConfigType> = (config, props) => {
|
|
14
15
|
return withPlugins(config, [
|
|
15
16
|
// iOS
|
|
16
17
|
withFirebaseAppDelegate,
|
|
17
18
|
withIosGoogleServicesFile,
|
|
19
|
+
[withIosDisableSPM, props],
|
|
18
20
|
|
|
19
21
|
// Android
|
|
20
22
|
withBuildscriptDependency,
|
package/plugin/src/ios/index.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { withFirebaseAppDelegate } from './appDelegate';
|
|
2
2
|
import { withIosGoogleServicesFile } from './googleServicesPlist';
|
|
3
|
+
import { withIosDisableSPM } from './podfile';
|
|
3
4
|
|
|
4
|
-
export { withIosGoogleServicesFile, withFirebaseAppDelegate };
|
|
5
|
+
export { withIosGoogleServicesFile, withFirebaseAppDelegate, withIosDisableSPM };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { ConfigPlugin, withPodfile } from '@expo/config-plugins';
|
|
2
|
+
import {
|
|
3
|
+
mergeContents,
|
|
4
|
+
removeGeneratedContents,
|
|
5
|
+
} from '@expo/config-plugins/build/utils/generateCode';
|
|
6
|
+
|
|
7
|
+
import { PluginConfigType } from '../pluginConfig';
|
|
8
|
+
|
|
9
|
+
const TAG = '@react-native-firebase/app-disableSPM';
|
|
10
|
+
const ANCHOR = /prepare_react_native_project!/;
|
|
11
|
+
const FLAG = '$RNFirebaseDisableSPM = true';
|
|
12
|
+
|
|
13
|
+
// The flag must be defined before any target block so firebase_spm.rb sees it
|
|
14
|
+
// when pods are declared - anchoring just after `prepare_react_native_project!`
|
|
15
|
+
// guarantees that in the Podfile Expo generates.
|
|
16
|
+
export function setAppPodfileDisableSPM(src: string, enabled: boolean = false): string {
|
|
17
|
+
if (!enabled) {
|
|
18
|
+
return removeGeneratedContents(src, TAG) ?? src;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
return mergeContents({
|
|
22
|
+
src,
|
|
23
|
+
newSrc: FLAG,
|
|
24
|
+
tag: TAG,
|
|
25
|
+
anchor: ANCHOR,
|
|
26
|
+
offset: 1,
|
|
27
|
+
comment: '#',
|
|
28
|
+
}).contents;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export const withIosDisableSPM: ConfigPlugin<PluginConfigType> = (config, props) => {
|
|
32
|
+
return withPodfile(config, config => {
|
|
33
|
+
config.modResults.contents = setAppPodfileDisableSPM(
|
|
34
|
+
config.modResults.contents,
|
|
35
|
+
props?.ios?.disableSPM === true,
|
|
36
|
+
);
|
|
37
|
+
|
|
38
|
+
return config;
|
|
39
|
+
});
|
|
40
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface PluginConfigType {
|
|
2
|
+
ios?: PluginConfigTypeIos;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
export interface PluginConfigTypeIos {
|
|
6
|
+
/**
|
|
7
|
+
* Sets `$RNFirebaseDisableSPM = true` in the Podfile, forcing Firebase
|
|
8
|
+
* dependencies to be installed with CocoaPods instead of Swift Package Manager.
|
|
9
|
+
*
|
|
10
|
+
* @platform ios iOS
|
|
11
|
+
*/
|
|
12
|
+
disableSPM?: boolean;
|
|
13
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"root":["./src/app.plugin.ts","./src/index.ts","./src/android/applyPlugin.ts","./src/android/buildscriptDependency.ts","./src/android/constants.ts","./src/android/copyGoogleServices.ts","./src/android/index.ts","./src/ios/appDelegate.ts","./src/ios/googleServicesPlist.ts","./src/ios/index.ts"],"version":"6.0.3"}
|
|
1
|
+
{"root":["./src/app.plugin.ts","./src/index.ts","./src/pluginConfig.ts","./src/android/applyPlugin.ts","./src/android/buildscriptDependency.ts","./src/android/constants.ts","./src/android/copyGoogleServices.ts","./src/android/index.ts","./src/ios/appDelegate.ts","./src/ios/googleServicesPlist.ts","./src/ios/index.ts","./src/ios/podfile.ts"],"version":"6.0.3"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the MIT license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
#import <Foundation/Foundation.h>
|
|
9
|
-
|
|
10
|
-
@protocol RCTModuleProvider;
|
|
11
|
-
|
|
12
|
-
@interface RCTModuleProviders: NSObject
|
|
13
|
-
|
|
14
|
-
+ (NSDictionary<NSString *, id<RCTModuleProvider>> *)moduleProviders;
|
|
15
|
-
|
|
16
|
-
@end
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the MIT license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
#import <Foundation/Foundation.h>
|
|
9
|
-
|
|
10
|
-
#import "RCTModuleProviders.h"
|
|
11
|
-
#import <ReactCommon/RCTTurboModule.h>
|
|
12
|
-
#import <React/RCTLog.h>
|
|
13
|
-
|
|
14
|
-
@implementation RCTModuleProviders
|
|
15
|
-
|
|
16
|
-
+ (NSDictionary<NSString *, id<RCTModuleProvider>> *)moduleProviders
|
|
17
|
-
{
|
|
18
|
-
static NSDictionary<NSString *, id<RCTModuleProvider>> *providers = nil;
|
|
19
|
-
static dispatch_once_t onceToken;
|
|
20
|
-
|
|
21
|
-
dispatch_once(&onceToken, ^{
|
|
22
|
-
NSDictionary<NSString *, NSString *> * moduleMapping = @{
|
|
23
|
-
@"NativeRNFBTurboApp": @"RNFBAppModule", // @react-native-firebase/app
|
|
24
|
-
@"NativeRNFBTurboUtils": @"RNFBUtilsModule", // @react-native-firebase/app
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
NSMutableDictionary *dict = [[NSMutableDictionary alloc] initWithCapacity:moduleMapping.count];
|
|
28
|
-
|
|
29
|
-
for (NSString *key in moduleMapping) {
|
|
30
|
-
NSString * moduleProviderName = moduleMapping[key];
|
|
31
|
-
Class klass = NSClassFromString(moduleProviderName);
|
|
32
|
-
if (!klass) {
|
|
33
|
-
RCTLogError(@"Module provider %@ cannot be found in the runtime", moduleProviderName);
|
|
34
|
-
continue;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
id instance = [klass new];
|
|
38
|
-
if (![instance respondsToSelector:@selector(getTurboModule:)]) {
|
|
39
|
-
RCTLogError(@"Module provider %@ does not conform to RCTModuleProvider", moduleProviderName);
|
|
40
|
-
continue;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
[dict setObject:instance forKey:key];
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
providers = dict;
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
return providers;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
@end
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the MIT license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
#import <Foundation/Foundation.h>
|
|
9
|
-
|
|
10
|
-
@interface RCTUnstableModulesRequiringMainQueueSetupProvider: NSObject
|
|
11
|
-
|
|
12
|
-
+(NSArray<NSString *> *)modules;
|
|
13
|
-
|
|
14
|
-
@end
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the MIT license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
#import "RCTUnstableModulesRequiringMainQueueSetupProvider.h"
|
|
9
|
-
|
|
10
|
-
@implementation RCTUnstableModulesRequiringMainQueueSetupProvider
|
|
11
|
-
|
|
12
|
-
+(NSArray<NSString *> *)modules
|
|
13
|
-
{
|
|
14
|
-
return @[
|
|
15
|
-
|
|
16
|
-
];
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
@end
|
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
-
#
|
|
3
|
-
# This source code is licensed under the MIT license found in the
|
|
4
|
-
# LICENSE file in the root directory of this source tree.
|
|
5
|
-
|
|
6
|
-
version = "0.82.1"
|
|
7
|
-
source = { :git => 'https://github.com/facebook/react-native.git' }
|
|
8
|
-
if version == '1000.0.0'
|
|
9
|
-
# This is an unpublished version, use the latest commit hash of the react-native repo, which we’re presumably in.
|
|
10
|
-
source[:commit] = `git rev-parse HEAD`.strip if system("git rev-parse --git-dir > /dev/null 2>&1")
|
|
11
|
-
else
|
|
12
|
-
source[:tag] = "v#{version}"
|
|
13
|
-
end
|
|
14
|
-
|
|
15
|
-
use_frameworks = ENV['USE_FRAMEWORKS'] != nil
|
|
16
|
-
folly_compiler_flags = Helpers::Constants.folly_config[:compiler_flags]
|
|
17
|
-
boost_compiler_flags = Helpers::Constants.boost_config[:compiler_flags]
|
|
18
|
-
|
|
19
|
-
header_search_paths = []
|
|
20
|
-
framework_search_paths = []
|
|
21
|
-
|
|
22
|
-
header_search_paths = [
|
|
23
|
-
"\"$(PODS_ROOT)/ReactNativeDependencies\"",
|
|
24
|
-
"\"${PODS_ROOT}/Headers/Public/ReactCodegen/react/renderer/components\"",
|
|
25
|
-
"\"$(PODS_ROOT)/Headers/Private/React-Fabric\"",
|
|
26
|
-
"\"$(PODS_ROOT)/Headers/Private/React-RCTFabric\"",
|
|
27
|
-
"\"$(PODS_ROOT)/Headers/Private/Yoga\"",
|
|
28
|
-
"\"$(PODS_TARGET_SRCROOT)\"",
|
|
29
|
-
]
|
|
30
|
-
|
|
31
|
-
if use_frameworks
|
|
32
|
-
ReactNativePodsUtils.create_header_search_path_for_frameworks("PODS_CONFIGURATION_BUILD_DIR", "React-Fabric", "React_Fabric", ["react/renderer/components/view/platform/cxx"])
|
|
33
|
-
.concat(ReactNativePodsUtils.create_header_search_path_for_frameworks("PODS_CONFIGURATION_BUILD_DIR", "React-FabricImage", "React_FabricImage", []))
|
|
34
|
-
.concat(ReactNativePodsUtils.create_header_search_path_for_frameworks("PODS_CONFIGURATION_BUILD_DIR", "React-graphics", "React_graphics", ["react/renderer/graphics/platform/ios"]))
|
|
35
|
-
.concat(ReactNativePodsUtils.create_header_search_path_for_frameworks("PODS_CONFIGURATION_BUILD_DIR", "ReactCommon", "ReactCommon", ["react/nativemodule/core"]))
|
|
36
|
-
.concat(ReactNativePodsUtils.create_header_search_path_for_frameworks("PODS_CONFIGURATION_BUILD_DIR", "React-runtimeexecutor", "React_runtimeexecutor", ["platform/ios"]))
|
|
37
|
-
.concat(ReactNativePodsUtils.create_header_search_path_for_frameworks("PODS_CONFIGURATION_BUILD_DIR", "React-NativeModulesApple", "React_NativeModulesApple", []))
|
|
38
|
-
.concat(ReactNativePodsUtils.create_header_search_path_for_frameworks("PODS_CONFIGURATION_BUILD_DIR", "React-RCTFabric", "RCTFabric", []))
|
|
39
|
-
.concat(ReactNativePodsUtils.create_header_search_path_for_frameworks("PODS_CONFIGURATION_BUILD_DIR", "React-debug", "React_debug", []))
|
|
40
|
-
.concat(ReactNativePodsUtils.create_header_search_path_for_frameworks("PODS_CONFIGURATION_BUILD_DIR", "React-rendererdebug", "React_rendererdebug", []))
|
|
41
|
-
.concat(ReactNativePodsUtils.create_header_search_path_for_frameworks("PODS_CONFIGURATION_BUILD_DIR", "React-utils", "React_utils", []))
|
|
42
|
-
.concat(ReactNativePodsUtils.create_header_search_path_for_frameworks("PODS_CONFIGURATION_BUILD_DIR", "React-featureflags", "React_featureflags", []))
|
|
43
|
-
.each { |search_path|
|
|
44
|
-
header_search_paths << "\"#{search_path}\""
|
|
45
|
-
}
|
|
46
|
-
end
|
|
47
|
-
|
|
48
|
-
Pod::Spec.new do |s|
|
|
49
|
-
s.name = "ReactCodegen"
|
|
50
|
-
s.version = version
|
|
51
|
-
s.summary = 'Temp pod for generated files for React Native'
|
|
52
|
-
s.homepage = 'https://facebook.com/'
|
|
53
|
-
s.license = 'Unlicense'
|
|
54
|
-
s.authors = 'Facebook'
|
|
55
|
-
s.compiler_flags = "#{folly_compiler_flags} #{boost_compiler_flags} -Wno-nullability-completeness -std=c++20"
|
|
56
|
-
s.source = { :git => '' }
|
|
57
|
-
s.header_mappings_dir = './'
|
|
58
|
-
s.platforms = min_supported_versions
|
|
59
|
-
s.source_files = "**/*.{h,mm,cpp}"
|
|
60
|
-
s.exclude_files = "RCTAppDependencyProvider.{h,mm}" # these files are generated in the same codegen path but needs to belong to a different pod
|
|
61
|
-
s.pod_target_xcconfig = {
|
|
62
|
-
"HEADER_SEARCH_PATHS" => header_search_paths.join(' '),
|
|
63
|
-
"FRAMEWORK_SEARCH_PATHS" => framework_search_paths,
|
|
64
|
-
"OTHER_CPLUSPLUSFLAGS" => "$(inherited) #{folly_compiler_flags} #{boost_compiler_flags}"
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
s.dependency "React-jsiexecutor"
|
|
68
|
-
s.dependency "RCTRequired"
|
|
69
|
-
s.dependency "RCTTypeSafety"
|
|
70
|
-
s.dependency "React-Core"
|
|
71
|
-
s.dependency "React-jsi"
|
|
72
|
-
s.dependency "ReactCommon/turbomodule/bridging"
|
|
73
|
-
s.dependency "ReactCommon/turbomodule/core"
|
|
74
|
-
s.dependency "React-NativeModulesApple"
|
|
75
|
-
s.dependency 'React-graphics'
|
|
76
|
-
s.dependency 'React-rendererdebug'
|
|
77
|
-
s.dependency 'React-Fabric'
|
|
78
|
-
s.dependency 'React-FabricImage'
|
|
79
|
-
s.dependency 'React-debug'
|
|
80
|
-
s.dependency 'React-utils'
|
|
81
|
-
s.dependency 'React-featureflags'
|
|
82
|
-
s.dependency 'React-RCTAppDelegate'
|
|
83
|
-
|
|
84
|
-
depend_on_js_engine(s)
|
|
85
|
-
add_rn_third_party_dependencies(s)
|
|
86
|
-
add_rncore_dependency(s)
|
|
87
|
-
|
|
88
|
-
s.script_phases = {
|
|
89
|
-
'name' => 'Generate Specs',
|
|
90
|
-
'execution_position' => :before_compile,
|
|
91
|
-
'input_files' => ["${PODS_ROOT}/../../specs/NativeRNFBTurboApp.ts",
|
|
92
|
-
"${PODS_ROOT}/../../specs/NativeRNFBTurboUtils.ts"],
|
|
93
|
-
'show_env_vars_in_log' => true,
|
|
94
|
-
'output_files' => ["${DERIVED_FILE_DIR}/react-codegen.log"],
|
|
95
|
-
'script': <<-SCRIPT
|
|
96
|
-
pushd "$PODS_ROOT/../" > /dev/null
|
|
97
|
-
RCT_SCRIPT_POD_INSTALLATION_ROOT=$(pwd)
|
|
98
|
-
popd >/dev/null
|
|
99
|
-
|
|
100
|
-
export RCT_SCRIPT_RN_DIR="$RCT_SCRIPT_POD_INSTALLATION_ROOT/../../../../node_modules/react-native"
|
|
101
|
-
export RCT_SCRIPT_APP_PATH="$RCT_SCRIPT_POD_INSTALLATION_ROOT/../.."
|
|
102
|
-
export RCT_SCRIPT_OUTPUT_DIR="$RCT_SCRIPT_POD_INSTALLATION_ROOT"
|
|
103
|
-
export RCT_SCRIPT_TYPE="withCodegenDiscovery"
|
|
104
|
-
|
|
105
|
-
export SCRIPT_PHASES_SCRIPT="$RCT_SCRIPT_RN_DIR/scripts/react_native_pods_utils/script_phases.sh"
|
|
106
|
-
export WITH_ENVIRONMENT="$RCT_SCRIPT_RN_DIR/scripts/xcode/with-environment.sh"
|
|
107
|
-
/bin/sh -c '"$WITH_ENVIRONMENT" "$SCRIPT_PHASES_SCRIPT"'
|
|
108
|
-
SCRIPT
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
end
|