@react-native-firebase/crashlytics 26.4.0 → 27.0.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.
Files changed (28) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/RNFBCrashlytics.podspec +7 -1
  3. package/android/build.gradle +7 -0
  4. package/android/src/main/java/io/invertase/firebase/crashlytics/Constants.kt +42 -0
  5. package/android/src/main/java/io/invertase/firebase/crashlytics/{JavaScriptError.java → JavaScriptError.kt} +4 -6
  6. package/android/src/main/java/io/invertase/firebase/crashlytics/ReactNativeFirebaseCrashlyticsNativeHelper.kt +45 -0
  7. package/android/src/main/java/io/invertase/firebase/crashlytics/{UnhandledPromiseRejection.java → UnhandledPromiseRejection.kt} +4 -6
  8. package/android/src/test/java/io/invertase/firebase/crashlytics/ConstantsAndJsErrorTypesTest.java +84 -0
  9. package/android/src/test/java/io/invertase/firebase/crashlytics/ReactNativeFirebaseCrashlyticsNativeHelperTest.java +108 -0
  10. package/dist/module/version.js +1 -1
  11. package/dist/typescript/lib/index.d.ts +1 -1
  12. package/dist/typescript/lib/version.d.ts +1 -1
  13. package/ios/RNFBCrashlytics/RNFBCrashlyticsDebuggerProbe.swift +121 -0
  14. package/ios/RNFBCrashlytics/RNFBCrashlyticsHelper.h +58 -0
  15. package/ios/RNFBCrashlytics/RNFBCrashlyticsHelper.m +109 -0
  16. package/ios/RNFBCrashlytics/RNFBCrashlyticsModule.mm +39 -71
  17. package/ios/RNFBCrashlytics.xcodeproj/project.pbxproj +14 -0
  18. package/ios/RNFBCrashlyticsUnitTests/HostStubs/Firebase/FIRCrashlyticsHostStub.m +207 -0
  19. package/ios/RNFBCrashlyticsUnitTests/HostStubs/Firebase/Firebase.h +47 -0
  20. package/ios/RNFBCrashlyticsUnitTests/RNFBCrashlyticsDebuggerProbeTests.swift +112 -0
  21. package/ios/RNFBCrashlyticsUnitTests/RNFBCrashlyticsHelperHostStubTests.m +119 -0
  22. package/ios/RNFBCrashlyticsUnitTests/RNFBCrashlyticsUnitTests.xcodeproj/project.pbxproj +261 -0
  23. package/ios/RNFBCrashlyticsUnitTests/RNFBCrashlyticsUnitTests.xcodeproj/xcshareddata/xcschemes/RNFBCrashlyticsUnitTests.xcscheme +69 -0
  24. package/ios_config.sh +28 -5
  25. package/lib/version.ts +1 -1
  26. package/package.json +4 -4
  27. package/android/src/main/java/io/invertase/firebase/crashlytics/Constants.java +0 -29
  28. package/android/src/main/java/io/invertase/firebase/crashlytics/ReactNativeFirebaseCrashlyticsNativeHelper.java +0 -18
@@ -0,0 +1,112 @@
1
+ /**
2
+ * Copyright (c) 2016-present Invertase Limited & Contributors
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this library except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ import Darwin
18
+ import XCTest
19
+
20
+ final class RNFBCrashlyticsDebuggerProbeTests: XCTestCase {
21
+
22
+ override func setUp() {
23
+ super.setUp()
24
+ RNFBCrashlyticsDebuggerProbe.resetForTesting()
25
+ }
26
+
27
+ override func tearDown() {
28
+ RNFBCrashlyticsDebuggerProbe.resetForTesting()
29
+ super.tearDown()
30
+ }
31
+
32
+ /// Writes a `kinfo_proc` with the given `p_flag` and returns 0 (success).
33
+ private func successProbe(pFlag: Int32) -> RNFBCrashlyticsDebuggerProbe.SysctlProbe {
34
+ { name, namelen, oldp, oldlenp, _, _ in
35
+ XCTAssertEqual(namelen, 4)
36
+ XCTAssertEqual(name[0], CTL_KERN)
37
+ XCTAssertEqual(name[1], KERN_PROC)
38
+ XCTAssertEqual(name[2], KERN_PROC_PID)
39
+ XCTAssertEqual(name[3], getpid())
40
+ guard let oldp else {
41
+ return -1
42
+ }
43
+ var info = kinfo_proc()
44
+ info.kp_proc.p_flag = pFlag
45
+ oldp.assumingMemoryBound(to: kinfo_proc.self).pointee = info
46
+ oldlenp.pointee = MemoryLayout<kinfo_proc>.size
47
+ return 0
48
+ }
49
+ }
50
+
51
+ /// Returns -1 after setting `errno` (sysctl failure path).
52
+ private func failureProbe(errnoValue: Int32, pFlag: Int32 = 0) -> RNFBCrashlyticsDebuggerProbe
53
+ .SysctlProbe
54
+ {
55
+ { _, _, oldp, oldlenp, _, _ in
56
+ if let oldp {
57
+ var info = kinfo_proc()
58
+ info.kp_proc.p_flag = pFlag
59
+ oldp.assumingMemoryBound(to: kinfo_proc.self).pointee = info
60
+ oldlenp.pointee = MemoryLayout<kinfo_proc>.size
61
+ }
62
+ errno = errnoValue
63
+ return -1
64
+ }
65
+ }
66
+
67
+ func testPublicPath_liveSysctl_returnsBoolWithoutCrash() {
68
+ // Exercises default Darwin.sysctl + once-cache. Under LLDB this may be true;
69
+ // on a non-debugged CI host it is typically false — do not assert the value.
70
+ _ = RNFBCrashlyticsDebuggerProbe.isDebuggerAttached()
71
+ // Second call must hit the once-cache return path.
72
+ _ = RNFBCrashlyticsDebuggerProbe.isDebuggerAttached()
73
+ }
74
+
75
+ func testEvaluate_notTraced_returnsFalse() {
76
+ let result = RNFBCrashlyticsDebuggerProbe.evaluateUncachedForTesting(
77
+ using: successProbe(pFlag: 0))
78
+ XCTAssertFalse(result)
79
+ }
80
+
81
+ func testEvaluate_pTraced_returnsTrue() {
82
+ let result = RNFBCrashlyticsDebuggerProbe.evaluateUncachedForTesting(
83
+ using: successProbe(pFlag: P_TRACED))
84
+ XCTAssertTrue(result)
85
+ }
86
+
87
+ func testEvaluate_sysctlFailure_logsAndReturnsFalse() {
88
+ let result = RNFBCrashlyticsDebuggerProbe.evaluateUncachedForTesting(
89
+ using: failureProbe(errnoValue: EINVAL, pFlag: 0))
90
+ XCTAssertFalse(result)
91
+ }
92
+
93
+ func testEvaluate_sysctlFailureWithTracedBit_stillTrueMatchingPrePortFallthrough() {
94
+ // Pre-port control flow still inspects P_TRACED after a failed sysctl.
95
+ let result = RNFBCrashlyticsDebuggerProbe.evaluateUncachedForTesting(
96
+ using: failureProbe(errnoValue: EFAULT, pFlag: P_TRACED))
97
+ XCTAssertTrue(result)
98
+ }
99
+
100
+ func testOnceCache_secondCallSkipsProbe() {
101
+ var probeCount = 0
102
+ let counting: RNFBCrashlyticsDebuggerProbe.SysctlProbe = { name, namelen, oldp, oldlenp, newp,
103
+ newlen in
104
+ probeCount += 1
105
+ return self.successProbe(pFlag: 0)(name, namelen, oldp, oldlenp, newp, newlen)
106
+ }
107
+ RNFBCrashlyticsDebuggerProbe.sysctlImpl = counting
108
+ XCTAssertFalse(RNFBCrashlyticsDebuggerProbe.isDebuggerAttached())
109
+ XCTAssertFalse(RNFBCrashlyticsDebuggerProbe.isDebuggerAttached())
110
+ XCTAssertEqual(probeCount, 1)
111
+ }
112
+ }
@@ -0,0 +1,119 @@
1
+ /**
2
+ * Copyright (c) 2016-present Invertase Limited & Contributors
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this library except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ #import <XCTest/XCTest.h>
18
+
19
+ #import <Firebase/Firebase.h>
20
+ #import "RNFBCrashlyticsHelper.h"
21
+
22
+ @interface RNFBCrashlyticsHelperHostStubTests : XCTestCase
23
+ @end
24
+
25
+ @implementation RNFBCrashlyticsHelperHostStubTests
26
+
27
+ - (void)setUp {
28
+ [super setUp];
29
+ [FIRCrashlytics resetTestState];
30
+ }
31
+
32
+ - (void)tearDown {
33
+ [FIRCrashlytics resetTestState];
34
+ [super tearDown];
35
+ }
36
+
37
+ - (void)testIsDebuggerAttached_returnsBoolWithoutCrash {
38
+ // Thin ObjC facade over Swift probe (already covered by DebuggerProbeTests).
39
+ BOOL attached = [RNFBCrashlyticsHelper isDebuggerAttached];
40
+ XCTAssertTrue(attached == YES || attached == NO);
41
+ }
42
+
43
+ - (void)testLog_forwardsMessage {
44
+ [RNFBCrashlyticsHelper log:@"hello-helper"];
45
+ XCTAssertEqualObjects(FIRCrashlytics.loggedMessages, @[ @"hello-helper" ]);
46
+ }
47
+
48
+ - (void)testSetCustomValue_andUserID {
49
+ [RNFBCrashlyticsHelper setCustomValue:@"v1" forKey:@"k1"];
50
+ [RNFBCrashlyticsHelper setUserID:@"user-42"];
51
+ XCTAssertEqualObjects(FIRCrashlytics.customValues[@"k1"], @"v1");
52
+ XCTAssertEqualObjects(FIRCrashlytics.userIDValue, @"user-42");
53
+ }
54
+
55
+ - (void)testSetCustomKeysAndValues_appliesEachEntry {
56
+ [RNFBCrashlyticsHelper setCustomKeysAndValues:@{@"a" : @"1", @"b" : @"2"}];
57
+ XCTAssertEqualObjects(FIRCrashlytics.customValues[@"a"], @"1");
58
+ XCTAssertEqualObjects(FIRCrashlytics.customValues[@"b"], @"2");
59
+ }
60
+
61
+ - (void)testCheckForUnsentReports_forwardsCompletionValue {
62
+ FIRCrashlytics.checkForUnsentReportsValue = YES;
63
+ __block NSNumber *seen = nil;
64
+ [RNFBCrashlyticsHelper checkForUnsentReportsWithCompletion:^(BOOL unsentReports) {
65
+ seen = @(unsentReports);
66
+ }];
67
+ XCTAssertEqualObjects(seen, @YES);
68
+ }
69
+
70
+ - (void)testCheckForUnsentReports_nilCompletion_doesNotCrash {
71
+ FIRCrashlytics.checkForUnsentReportsValue = NO;
72
+ [RNFBCrashlyticsHelper checkForUnsentReportsWithCompletion:nil];
73
+ }
74
+
75
+ - (void)testDidCrashDuringPreviousExecution_forwardsStubValue {
76
+ FIRCrashlytics.didCrashDuringPreviousExecutionValue = YES;
77
+ XCTAssertTrue([RNFBCrashlyticsHelper didCrashDuringPreviousExecution]);
78
+ }
79
+
80
+ - (void)testDeleteAndSendUnsentReports_incrementCallCounts {
81
+ [RNFBCrashlyticsHelper deleteUnsentReports];
82
+ [RNFBCrashlyticsHelper sendUnsentReports];
83
+ XCTAssertEqual(FIRCrashlytics.deleteUnsentReportsCallCount, 1u);
84
+ XCTAssertEqual(FIRCrashlytics.sendUnsentReportsCallCount, 1u);
85
+ }
86
+
87
+ - (void)testRecordJavaScriptError_buildsExceptionModelWithFrames {
88
+ NSArray *frames = @[
89
+ @{@"fn" : @"doThing", @"file" : @"app.js", @"line" : @12},
90
+ @{@"fn" : @"main", @"file" : @"index.js", @"line" : @3},
91
+ ];
92
+
93
+ [RNFBCrashlyticsHelper recordJavaScriptErrorWithMessage:@"boom"
94
+ frames:frames
95
+ isUnhandledPromiseRejection:NO];
96
+
97
+ FIRExceptionModel *model = FIRCrashlytics.lastRecordedExceptionModel;
98
+ XCTAssertNotNil(model);
99
+ XCTAssertEqualObjects(model.name, @"JavaScriptError");
100
+ XCTAssertEqualObjects(model.reason, @"boom");
101
+ XCTAssertEqual(model.stackTrace.count, 2u);
102
+ XCTAssertEqualObjects(model.stackTrace[0].symbol, @"doThing");
103
+ XCTAssertEqualObjects(model.stackTrace[0].file, @"app.js");
104
+ XCTAssertEqual(model.stackTrace[0].line, 12u);
105
+ XCTAssertEqualObjects(model.stackTrace[1].symbol, @"main");
106
+ }
107
+
108
+ - (void)testRecordJavaScriptError_unhandledRejection_usesRejectionName {
109
+ [RNFBCrashlyticsHelper recordJavaScriptErrorWithMessage:@"rejected"
110
+ frames:@[]
111
+ isUnhandledPromiseRejection:YES];
112
+
113
+ FIRExceptionModel *model = FIRCrashlytics.lastRecordedExceptionModel;
114
+ XCTAssertEqualObjects(model.name, @"UnhandledPromiseRejection");
115
+ XCTAssertEqualObjects(model.reason, @"rejected");
116
+ XCTAssertEqual(model.stackTrace.count, 0u);
117
+ }
118
+
119
+ @end
@@ -0,0 +1,261 @@
1
+ // !$*UTF8*$!
2
+ {
3
+ archiveVersion = 1;
4
+ classes = {
5
+ };
6
+ objectVersion = 56;
7
+ objects = {
8
+
9
+ /* Begin PBXBuildFile section */
10
+ CL100000000000000000000B /* RNFBCrashlyticsDebuggerProbe.swift in Sources */ = {isa = PBXBuildFile; fileRef = CL1000000000000000000009 /* RNFBCrashlyticsDebuggerProbe.swift */; };
11
+ CL100000000000000000000C /* RNFBCrashlyticsDebuggerProbeTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = CL100000000000000000000D /* RNFBCrashlyticsDebuggerProbeTests.swift */; };
12
+ CL1000000000000000000015 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CL1000000000000000000014 /* XCTest.framework */; };
13
+ CL1000000000000000000020 /* RNFBCrashlyticsHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = CL1000000000000000000021 /* RNFBCrashlyticsHelper.m */; };
14
+ CL1000000000000000000022 /* RNFBCrashlyticsHelperHostStubTests.m in Sources */ = {isa = PBXBuildFile; fileRef = CL1000000000000000000023 /* RNFBCrashlyticsHelperHostStubTests.m */; };
15
+ CL1000000000000000000024 /* FIRCrashlyticsHostStub.m in Sources */ = {isa = PBXBuildFile; fileRef = CL1000000000000000000025 /* FIRCrashlyticsHostStub.m */; };
16
+ /* End PBXBuildFile section */
17
+
18
+ /* Begin PBXFileReference section */
19
+ CL1000000000000000000003 /* RNFBCrashlyticsUnitTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RNFBCrashlyticsUnitTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
20
+ CL1000000000000000000009 /* RNFBCrashlyticsDebuggerProbe.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = RNFBCrashlyticsDebuggerProbe.swift; path = ../RNFBCrashlytics/RNFBCrashlyticsDebuggerProbe.swift; sourceTree = SOURCE_ROOT; };
21
+ CL100000000000000000000D /* RNFBCrashlyticsDebuggerProbeTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RNFBCrashlyticsDebuggerProbeTests.swift; sourceTree = "<group>"; };
22
+ CL1000000000000000000014 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Platforms/MacOSX.platform/Developer/Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; };
23
+ CL1000000000000000000021 /* RNFBCrashlyticsHelper.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = RNFBCrashlyticsHelper.m; path = ../RNFBCrashlytics/RNFBCrashlyticsHelper.m; sourceTree = SOURCE_ROOT; };
24
+ CL1000000000000000000023 /* RNFBCrashlyticsHelperHostStubTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RNFBCrashlyticsHelperHostStubTests.m; sourceTree = "<group>"; };
25
+ CL1000000000000000000025 /* FIRCrashlyticsHostStub.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = FIRCrashlyticsHostStub.m; path = HostStubs/Firebase/FIRCrashlyticsHostStub.m; sourceTree = "<group>"; };
26
+ CL1000000000000000000026 /* RNFBCrashlyticsHelper.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = RNFBCrashlyticsHelper.h; path = ../RNFBCrashlytics/RNFBCrashlyticsHelper.h; sourceTree = SOURCE_ROOT; };
27
+ /* End PBXFileReference section */
28
+
29
+ /* Begin PBXFrameworksBuildPhase section */
30
+ CL1000000000000000000012 /* Frameworks */ = {
31
+ isa = PBXFrameworksBuildPhase;
32
+ buildActionMask = 2147483647;
33
+ files = (
34
+ CL1000000000000000000015 /* XCTest.framework in Frameworks */,
35
+ );
36
+ runOnlyForDeploymentPostprocessing = 0;
37
+ };
38
+ /* End PBXFrameworksBuildPhase section */
39
+
40
+ /* Begin PBXGroup section */
41
+ CL1000000000000000000004 = {
42
+ isa = PBXGroup;
43
+ children = (
44
+ CL1000000000000000000006 /* Sources */,
45
+ CL1000000000000000000005 /* Products */,
46
+ );
47
+ sourceTree = "<group>";
48
+ };
49
+ CL1000000000000000000005 /* Products */ = {
50
+ isa = PBXGroup;
51
+ children = (
52
+ CL1000000000000000000003 /* RNFBCrashlyticsUnitTests.xctest */,
53
+ );
54
+ name = Products;
55
+ sourceTree = "<group>";
56
+ };
57
+ CL1000000000000000000006 /* Sources */ = {
58
+ isa = PBXGroup;
59
+ children = (
60
+ CL1000000000000000000009 /* RNFBCrashlyticsDebuggerProbe.swift */,
61
+ CL100000000000000000000D /* RNFBCrashlyticsDebuggerProbeTests.swift */,
62
+ CL1000000000000000000026 /* RNFBCrashlyticsHelper.h */,
63
+ CL1000000000000000000021 /* RNFBCrashlyticsHelper.m */,
64
+ CL1000000000000000000023 /* RNFBCrashlyticsHelperHostStubTests.m */,
65
+ CL1000000000000000000025 /* FIRCrashlyticsHostStub.m */,
66
+ );
67
+ name = Sources;
68
+ sourceTree = "<group>";
69
+ };
70
+ /* End PBXGroup section */
71
+
72
+ /* Begin PBXNativeTarget section */
73
+ CL1000000000000000000002 /* RNFBCrashlyticsUnitTests */ = {
74
+ isa = PBXNativeTarget;
75
+ buildConfigurationList = CL1000000000000000000013 /* Build configuration list for PBXNativeTarget "RNFBCrashlyticsUnitTests" */;
76
+ buildPhases = (
77
+ CL1000000000000000000016 /* Sources */,
78
+ CL1000000000000000000012 /* Frameworks */,
79
+ );
80
+ buildRules = (
81
+ );
82
+ dependencies = (
83
+ );
84
+ name = RNFBCrashlyticsUnitTests;
85
+ productName = RNFBCrashlyticsUnitTests;
86
+ productReference = CL1000000000000000000003 /* RNFBCrashlyticsUnitTests.xctest */;
87
+ productType = "com.apple.product-type.bundle.unit-test";
88
+ };
89
+ /* End PBXNativeTarget section */
90
+
91
+ /* Begin PBXProject section */
92
+ CL1000000000000000000001 /* Project object */ = {
93
+ isa = PBXProject;
94
+ attributes = {
95
+ BuildIndependentTargetsInParallel = 1;
96
+ LastUpgradeCheck = 2600;
97
+ ORGANIZATIONNAME = Invertase;
98
+ TargetAttributes = {
99
+ CL1000000000000000000002 = {
100
+ CreatedOnToolsVersion = 26.0;
101
+ };
102
+ };
103
+ };
104
+ buildConfigurationList = CL1000000000000000000017 /* Build configuration list for PBXProject "RNFBCrashlyticsUnitTests" */;
105
+ compatibilityVersion = "Xcode 14.0";
106
+ developmentRegion = en;
107
+ hasScannedForEncodings = 0;
108
+ knownRegions = (
109
+ en,
110
+ Base,
111
+ );
112
+ mainGroup = CL1000000000000000000004;
113
+ productRefGroup = CL1000000000000000000005 /* Products */;
114
+ projectDirPath = "";
115
+ projectRoot = "";
116
+ targets = (
117
+ CL1000000000000000000002 /* RNFBCrashlyticsUnitTests */,
118
+ );
119
+ };
120
+ /* End PBXProject section */
121
+
122
+ /* Begin PBXSourcesBuildPhase section */
123
+ CL1000000000000000000016 /* Sources */ = {
124
+ isa = PBXSourcesBuildPhase;
125
+ buildActionMask = 2147483647;
126
+ files = (
127
+ CL100000000000000000000B /* RNFBCrashlyticsDebuggerProbe.swift in Sources */,
128
+ CL100000000000000000000C /* RNFBCrashlyticsDebuggerProbeTests.swift in Sources */,
129
+ CL1000000000000000000020 /* RNFBCrashlyticsHelper.m in Sources */,
130
+ CL1000000000000000000024 /* FIRCrashlyticsHostStub.m in Sources */,
131
+ CL1000000000000000000022 /* RNFBCrashlyticsHelperHostStubTests.m in Sources */,
132
+ );
133
+ runOnlyForDeploymentPostprocessing = 0;
134
+ };
135
+ /* End PBXSourcesBuildPhase section */
136
+
137
+ /* Begin XCBuildConfiguration section */
138
+ CL1000000000000000000018 /* Debug */ = {
139
+ isa = XCBuildConfiguration;
140
+ buildSettings = {
141
+ ALWAYS_SEARCH_USER_PATHS = NO;
142
+ CLANG_ENABLE_MODULES = YES;
143
+ CLANG_ENABLE_OBJC_ARC = YES;
144
+ COPY_PHASE_STRIP = NO;
145
+ DEBUG_INFORMATION_FORMAT = dwarf;
146
+ ENABLE_TESTABILITY = YES;
147
+ GCC_C_LANGUAGE_STANDARD = gnu17;
148
+ GCC_DYNAMIC_NO_PIC = NO;
149
+ GCC_OPTIMIZATION_LEVEL = 0;
150
+ MACOSX_DEPLOYMENT_TARGET = 14.0;
151
+ ONLY_ACTIVE_ARCH = YES;
152
+ SDKROOT = macosx;
153
+ SUPPORTED_PLATFORMS = macosx;
154
+ };
155
+ name = Debug;
156
+ };
157
+ CL1000000000000000000019 /* Release */ = {
158
+ isa = XCBuildConfiguration;
159
+ buildSettings = {
160
+ ALWAYS_SEARCH_USER_PATHS = NO;
161
+ CLANG_ENABLE_MODULES = YES;
162
+ CLANG_ENABLE_OBJC_ARC = YES;
163
+ COPY_PHASE_STRIP = YES;
164
+ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
165
+ GCC_C_LANGUAGE_STANDARD = gnu17;
166
+ MACOSX_DEPLOYMENT_TARGET = 14.0;
167
+ SDKROOT = macosx;
168
+ SUPPORTED_PLATFORMS = macosx;
169
+ };
170
+ name = Release;
171
+ };
172
+ CL100000000000000000001A /* Debug */ = {
173
+ isa = XCBuildConfiguration;
174
+ buildSettings = {
175
+ CLANG_ENABLE_CODE_COVERAGE = YES;
176
+ CODE_SIGNING_ALLOWED = NO;
177
+ CODE_SIGNING_REQUIRED = NO;
178
+ CODE_SIGN_IDENTITY = "-";
179
+ COMBINE_HIDPI_IMAGES = YES;
180
+ DEFINES_MODULE = YES;
181
+ GENERATE_INFOPLIST_FILE = YES;
182
+ HEADER_SEARCH_PATHS = (
183
+ "$(SRCROOT)/HostStubs",
184
+ "$(SRCROOT)/../RNFBCrashlytics",
185
+ );
186
+ LD_RUNPATH_SEARCH_PATHS = (
187
+ "$(inherited)",
188
+ "@executable_path/../Frameworks",
189
+ "@loader_path/../Frameworks",
190
+ );
191
+ MACOSX_DEPLOYMENT_TARGET = 14.0;
192
+ OTHER_CFLAGS = (
193
+ "-fprofile-instr-generate",
194
+ "-fcoverage-mapping",
195
+ );
196
+ OTHER_LDFLAGS = (
197
+ "-fprofile-instr-generate",
198
+ );
199
+ PRODUCT_BUNDLE_IDENTIFIER = io.invertase.firebase.RNFBCrashlyticsUnitTests;
200
+ PRODUCT_NAME = "$(TARGET_NAME)";
201
+ SDKROOT = macosx;
202
+ SUPPORTED_PLATFORMS = macosx;
203
+ SWIFT_OBJC_INTERFACE_HEADER_NAME = "RNFBCrashlyticsDebuggerProbe-Swift.inc";
204
+ SWIFT_VERSION = 5.10;
205
+ };
206
+ name = Debug;
207
+ };
208
+ CL100000000000000000001B /* Release */ = {
209
+ isa = XCBuildConfiguration;
210
+ buildSettings = {
211
+ CLANG_ENABLE_CODE_COVERAGE = YES;
212
+ CODE_SIGNING_ALLOWED = NO;
213
+ CODE_SIGNING_REQUIRED = NO;
214
+ CODE_SIGN_IDENTITY = "-";
215
+ COMBINE_HIDPI_IMAGES = YES;
216
+ DEFINES_MODULE = YES;
217
+ GENERATE_INFOPLIST_FILE = YES;
218
+ HEADER_SEARCH_PATHS = (
219
+ "$(SRCROOT)/HostStubs",
220
+ "$(SRCROOT)/../RNFBCrashlytics",
221
+ );
222
+ LD_RUNPATH_SEARCH_PATHS = (
223
+ "$(inherited)",
224
+ "@executable_path/../Frameworks",
225
+ "@loader_path/../Frameworks",
226
+ );
227
+ MACOSX_DEPLOYMENT_TARGET = 14.0;
228
+ PRODUCT_BUNDLE_IDENTIFIER = io.invertase.firebase.RNFBCrashlyticsUnitTests;
229
+ PRODUCT_NAME = "$(TARGET_NAME)";
230
+ SDKROOT = macosx;
231
+ SUPPORTED_PLATFORMS = macosx;
232
+ SWIFT_OBJC_INTERFACE_HEADER_NAME = "RNFBCrashlyticsDebuggerProbe-Swift.inc";
233
+ SWIFT_VERSION = 5.10;
234
+ };
235
+ name = Release;
236
+ };
237
+ /* End XCBuildConfiguration section */
238
+
239
+ /* Begin XCConfigurationList section */
240
+ CL1000000000000000000017 /* Build configuration list for PBXProject "RNFBCrashlyticsUnitTests" */ = {
241
+ isa = XCConfigurationList;
242
+ buildConfigurations = (
243
+ CL1000000000000000000018 /* Debug */,
244
+ CL1000000000000000000019 /* Release */,
245
+ );
246
+ defaultConfigurationIsVisible = 0;
247
+ defaultConfigurationName = Debug;
248
+ };
249
+ CL1000000000000000000013 /* Build configuration list for PBXNativeTarget "RNFBCrashlyticsUnitTests" */ = {
250
+ isa = XCConfigurationList;
251
+ buildConfigurations = (
252
+ CL100000000000000000001A /* Debug */,
253
+ CL100000000000000000001B /* Release */,
254
+ );
255
+ defaultConfigurationIsVisible = 0;
256
+ defaultConfigurationName = Debug;
257
+ };
258
+ /* End XCConfigurationList section */
259
+ };
260
+ rootObject = CL1000000000000000000001 /* Project object */;
261
+ }
@@ -0,0 +1,69 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <Scheme
3
+ LastUpgradeVersion = "2600"
4
+ version = "1.7">
5
+ <BuildAction
6
+ parallelizeBuildables = "YES"
7
+ buildImplicitDependencies = "YES">
8
+ <BuildActionEntries>
9
+ <BuildActionEntry
10
+ buildForTesting = "YES"
11
+ buildForRunning = "YES"
12
+ buildForProfiling = "NO"
13
+ buildForArchiving = "NO"
14
+ buildForAnalyzing = "YES">
15
+ <BuildableReference
16
+ BuildableIdentifier = "primary"
17
+ BlueprintIdentifier = "CL1000000000000000000002"
18
+ BuildableName = "RNFBCrashlyticsUnitTests.xctest"
19
+ BlueprintName = "RNFBCrashlyticsUnitTests"
20
+ ReferencedContainer = "container:RNFBCrashlyticsUnitTests.xcodeproj">
21
+ </BuildableReference>
22
+ </BuildActionEntry>
23
+ </BuildActionEntries>
24
+ </BuildAction>
25
+ <TestAction
26
+ buildConfiguration = "Debug"
27
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
28
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29
+ shouldUseLaunchSchemeArgsEnv = "YES"
30
+ codeCoverageEnabled = "YES">
31
+ <Testables>
32
+ <TestableReference
33
+ skipped = "NO">
34
+ <BuildableReference
35
+ BuildableIdentifier = "primary"
36
+ BlueprintIdentifier = "CL1000000000000000000002"
37
+ BuildableName = "RNFBCrashlyticsUnitTests.xctest"
38
+ BlueprintName = "RNFBCrashlyticsUnitTests"
39
+ ReferencedContainer = "container:RNFBCrashlyticsUnitTests.xcodeproj">
40
+ </BuildableReference>
41
+ </TestableReference>
42
+ </Testables>
43
+ </TestAction>
44
+ <LaunchAction
45
+ buildConfiguration = "Debug"
46
+ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
47
+ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
48
+ launchStyle = "0"
49
+ useCustomWorkingDirectory = "NO"
50
+ ignoresPersistentStateOnLaunch = "NO"
51
+ debugDocumentVersioning = "YES"
52
+ debugServiceExtension = "internal"
53
+ allowLocationSimulation = "YES">
54
+ </LaunchAction>
55
+ <ProfileAction
56
+ buildConfiguration = "Release"
57
+ shouldUseLaunchSchemeArgsEnv = "YES"
58
+ savedToolIdentifier = ""
59
+ useCustomWorkingDirectory = "NO"
60
+ debugDocumentVersioning = "YES">
61
+ </ProfileAction>
62
+ <AnalyzeAction
63
+ buildConfiguration = "Debug">
64
+ </AnalyzeAction>
65
+ <ArchiveAction
66
+ buildConfiguration = "Release"
67
+ revealArchiveInOrganizer = "YES">
68
+ </ArchiveAction>
69
+ </Scheme>
package/ios_config.sh CHANGED
@@ -18,23 +18,46 @@ set -e
18
18
 
19
19
  if [[ ${PODS_ROOT} && -f "${PODS_ROOT}/FirebaseCrashlytics/run" ]]; then
20
20
  echo "info: Exec FirebaseCrashlytics Run from Pods"
21
- "${PODS_ROOT}/FirebaseCrashlytics/run"
21
+ if ! "${PODS_ROOT}/FirebaseCrashlytics/run"; then
22
+ echo "warning: FirebaseCrashlytics run (CocoaPods) failed; continuing without failing the build. Common causes: no network, invalid/placeholder GoogleService-Info.plist credentials, or Firebase project mismatch."
23
+ fi
22
24
  elif [[ -f "${PROJECT_DIR}/FirebaseCrashlytics.framework/run" ]]; then
23
25
  echo "info: Exec FirebaseCrashlytics Run from framework"
24
- "${PROJECT_DIR}/FirebaseCrashlytics.framework/run"
26
+ if ! "${PROJECT_DIR}/FirebaseCrashlytics.framework/run"; then
27
+ echo "warning: FirebaseCrashlytics run (framework) failed; continuing without failing the build. Common causes: no network, invalid/placeholder GoogleService-Info.plist credentials, or Firebase project mismatch."
28
+ fi
25
29
  else
26
30
  # SPM: upload-symbols is at a known path in the SourcePackages checkout.
27
31
  # BUILD_DIR is typically DerivedData/Project-hash/Build/Products — strip from /Build onward
28
32
  # to get the DerivedData project root where SourcePackages lives.
29
33
  SPM_CRASHLYTICS_DIR="${BUILD_DIR%Build/*}SourcePackages/checkouts/firebase-ios-sdk/Crashlytics"
30
34
  SPM_UPLOAD_SYMBOLS="${SPM_CRASHLYTICS_DIR}/upload-symbols"
31
- if [[ -x "${SPM_UPLOAD_SYMBOLS}" ]]; then
35
+
36
+ # GoogleService-Info.plist normally lives in the target folder
37
+ # (ios/<TargetName>/GoogleService-Info.plist) — that's where both Expo's config
38
+ # plugin and RNFB's documented manual/CLI setup place it. Fall back to the
39
+ # PROJECT_DIR root for setups that put it there instead.
40
+ if [[ -n "${TARGET_NAME}" && -f "${PROJECT_DIR}/${TARGET_NAME}/GoogleService-Info.plist" ]]; then
41
+ GSP_PATH="${PROJECT_DIR}/${TARGET_NAME}/GoogleService-Info.plist"
42
+ elif [[ -f "${PROJECT_DIR}/GoogleService-Info.plist" ]]; then
43
+ GSP_PATH="${PROJECT_DIR}/GoogleService-Info.plist"
44
+ else
45
+ GSP_PATH=""
46
+ fi
47
+
48
+ if [[ -z "${GSP_PATH}" ]]; then
49
+ echo "warning: GoogleService-Info.plist not found at ${PROJECT_DIR}/${TARGET_NAME}/GoogleService-Info.plist or ${PROJECT_DIR}/GoogleService-Info.plist. Skipping dSYM upload."
50
+ elif [[ -x "${SPM_UPLOAD_SYMBOLS}" ]]; then
32
51
  echo "info: Exec FirebaseCrashlytics upload-symbols from SPM"
33
- "${SPM_UPLOAD_SYMBOLS}" -gsp "${PROJECT_DIR}/GoogleService-Info.plist" -p ios "${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}"
52
+ if ! "${SPM_UPLOAD_SYMBOLS}" -gsp "${GSP_PATH}" -p ios "${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}"; then
53
+ echo "warning: FirebaseCrashlytics upload-symbols (SPM) failed; continuing without failing the build. Common causes: no network, invalid/placeholder GoogleService-Info.plist credentials, or Firebase project mismatch."
54
+ fi
34
55
  elif [[ -f "${SPM_UPLOAD_SYMBOLS}" ]]; then
35
56
  echo "info: Exec FirebaseCrashlytics upload-symbols from SPM (chmod +x)"
36
57
  chmod +x "${SPM_UPLOAD_SYMBOLS}"
37
- "${SPM_UPLOAD_SYMBOLS}" -gsp "${PROJECT_DIR}/GoogleService-Info.plist" -p ios "${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}"
58
+ if ! "${SPM_UPLOAD_SYMBOLS}" -gsp "${GSP_PATH}" -p ios "${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}"; then
59
+ echo "warning: FirebaseCrashlytics upload-symbols (SPM) failed; continuing without failing the build. Common causes: no network, invalid/placeholder GoogleService-Info.plist credentials, or Firebase project mismatch."
60
+ fi
38
61
  else
39
62
  echo "warning: FirebaseCrashlytics run script not found at CocoaPods, framework, or SPM paths. Skipping dSYM upload."
40
63
  echo "warning: Checked: \${PODS_ROOT}/FirebaseCrashlytics/run, \${PROJECT_DIR}/FirebaseCrashlytics.framework/run, ${SPM_UPLOAD_SYMBOLS}"
package/lib/version.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  // Generated by genversion.
2
- export const version = '26.4.0';
2
+ export const version = '27.0.0';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-native-firebase/crashlytics",
3
- "version": "26.4.0",
3
+ "version": "27.0.0",
4
4
  "author": "Invertase <oss@invertase.io> (http://invertase.io)",
5
5
  "description": "React Native Firebase - Firebase Crashlytics is a lightweight, realtime crash reporter that helps you track, prioritize, and fix stability issues that erode your app quality. React Native Firebase provides automatic crash reporting for both native and JavaScript errors, including unhandled promise rejections.",
6
6
  "main": "./dist/module/index.js",
@@ -49,14 +49,14 @@
49
49
  "crashlytics"
50
50
  ],
51
51
  "peerDependencies": {
52
- "@react-native-firebase/app": "26.4.0",
52
+ "@react-native-firebase/app": "27.0.0",
53
53
  "expo": ">=47.0.0"
54
54
  },
55
55
  "dependencies": {
56
56
  "stacktrace-js": "^2.0.2"
57
57
  },
58
58
  "devDependencies": {
59
- "@react-native-firebase/app": "26.4.0",
59
+ "@react-native-firebase/app": "27.0.0",
60
60
  "expo": "^55.0.18",
61
61
  "react-native-builder-bob": "^0.41.0",
62
62
  "typescript": "^6.0.3"
@@ -104,5 +104,5 @@
104
104
  ]
105
105
  ]
106
106
  },
107
- "gitHead": "06701af5fdc19bae9f379567eadb29dfe81953c0"
107
+ "gitHead": "0c7e942bca361f1765abaf233bf447d795718eff"
108
108
  }
@@ -1,29 +0,0 @@
1
- package io.invertase.firebase.crashlytics;
2
-
3
- /*
4
- * Copyright (c) 2016-present Invertase Limited & Contributors
5
- *
6
- * Licensed under the Apache License, Version 2.0 (the "License");
7
- * you may not use this library except in compliance with the License.
8
- * You may obtain a copy of the License at
9
- *
10
- * http://www.apache.org/licenses/LICENSE-2.0
11
- *
12
- * Unless required by applicable law or agreed to in writing, software
13
- * distributed under the License is distributed on an "AS IS" BASIS,
14
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
- * See the License for the specific language governing permissions and
16
- * limitations under the License.
17
- *
18
- */
19
-
20
- class Constants {
21
- static final String KEY_CRASHLYTICS_NDK_ENABLED = "crashlytics_ndk_enabled";
22
- static final String KEY_CRASHLYTICS_DEBUG_ENABLED = "crashlytics_debug_enabled";
23
- static final String KEY_CRASHLYTICS_AUTO_COLLECTION_ENABLED =
24
- "crashlytics_auto_collection_enabled";
25
- static final String KEY_CRASHLYTICS_IS_ERROR_GENERATION_ON_JS_CRASH_ENABLED =
26
- "crashlytics_is_error_generation_on_js_crash_enabled";
27
- static final String KEY_CRASHLYTICS_JAVASCRIPT_EXCEPTION_HANDLER_CHAINING_ENABLED =
28
- "crashlytics_javascript_exception_handler_chaining_enabled";
29
- }