@react-native-firebase/crashlytics 25.1.0 → 26.1.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 +22 -0
- package/RNFBCrashlytics.podspec +22 -8
- package/android/build.gradle +23 -0
- package/android/src/main/java/io/invertase/firebase/crashlytics/{ReactNativeFirebaseCrashlyticsModule.java → NativeRNFBTurboCrashlytics.java} +44 -39
- package/android/src/main/java/io/invertase/firebase/crashlytics/ReactNativeFirebaseCrashlyticsPackage.java +1 -1
- package/android/src/main/java/io/invertase/firebase/crashlytics/generated/java/com/facebook/fbreact/specs/NativeRNFBTurboCrashlyticsSpec.java +125 -0
- package/android/src/main/java/io/invertase/firebase/crashlytics/generated/jni/CMakeLists.txt +36 -0
- package/android/src/main/java/io/invertase/firebase/crashlytics/generated/jni/RNFBCrashlyticsTurboModules-generated.cpp +116 -0
- package/android/src/main/java/io/invertase/firebase/crashlytics/generated/jni/RNFBCrashlyticsTurboModules.h +31 -0
- package/android/src/main/java/io/invertase/firebase/crashlytics/generated/jni/react/renderer/components/RNFBCrashlyticsTurboModules/RNFBCrashlyticsTurboModulesJSI-generated.cpp +124 -0
- package/android/src/main/java/io/invertase/firebase/crashlytics/generated/jni/react/renderer/components/RNFBCrashlyticsTurboModules/RNFBCrashlyticsTurboModulesJSI.h +320 -0
- package/app.plugin.js +1 -1
- package/dist/module/handlers.js +7 -24
- package/dist/module/handlers.js.map +1 -1
- package/dist/module/index.js +125 -8
- package/dist/module/index.js.map +1 -1
- package/dist/module/types/crashlytics.js +1 -40
- package/dist/module/types/crashlytics.js.map +1 -1
- package/dist/module/types/internal.js +4 -0
- package/dist/module/types/internal.js.map +1 -0
- package/dist/module/version.js +1 -1
- package/dist/typescript/lib/handlers.d.ts.map +1 -1
- package/dist/typescript/lib/index.d.ts +19 -4
- package/dist/typescript/lib/index.d.ts.map +1 -1
- package/dist/typescript/lib/types/crashlytics.d.ts +0 -21
- package/dist/typescript/lib/types/crashlytics.d.ts.map +1 -1
- package/dist/typescript/lib/types/internal.d.ts +44 -0
- package/dist/typescript/lib/types/internal.d.ts.map +1 -0
- package/dist/typescript/lib/version.d.ts +1 -1
- package/ios/RNFBCrashlytics/RNFBCrashlyticsInitProvider.h +15 -6
- package/ios/RNFBCrashlytics/RNFBCrashlyticsInitProvider.m +24 -1
- package/ios/RNFBCrashlytics/RNFBCrashlyticsModule.h +2 -3
- package/ios/RNFBCrashlytics/{RNFBCrashlyticsModule.m → RNFBCrashlyticsModule.mm} +72 -72
- package/ios/RNFBCrashlytics/RNFBCrashlyticsNativeHelper.m +8 -0
- package/ios/RNFBCrashlytics.xcodeproj/project.pbxproj +8 -8
- package/ios/generated/RCTAppDependencyProvider.h +25 -0
- package/ios/generated/RCTAppDependencyProvider.mm +55 -0
- package/ios/generated/RCTModulesConformingToProtocolsProvider.h +18 -0
- package/ios/generated/RCTModulesConformingToProtocolsProvider.mm +33 -0
- package/ios/generated/RCTThirdPartyComponentsProvider.h +16 -0
- package/ios/generated/RCTThirdPartyComponentsProvider.mm +23 -0
- package/ios/generated/RNFBCrashlyticsTurboModules/RNFBCrashlyticsTurboModules-generated.mm +148 -0
- package/ios/generated/RNFBCrashlyticsTurboModules/RNFBCrashlyticsTurboModules.h +214 -0
- package/ios/generated/RNFBCrashlyticsTurboModulesJSI-generated.cpp +124 -0
- package/ios/generated/RNFBCrashlyticsTurboModulesJSI.h +320 -0
- package/ios/generated/ReactAppDependencyProvider.podspec +34 -0
- package/ios_config.sh +19 -2
- package/lib/handlers.ts +7 -26
- package/lib/index.ts +209 -7
- package/lib/types/crashlytics.ts +0 -30
- package/lib/types/internal.ts +59 -0
- package/lib/version.ts +1 -1
- package/package.json +30 -5
- package/plugin/build/app.plugin.d.ts +2 -0
- package/plugin/build/app.plugin.js +6 -0
- package/plugin/src/app.plugin.ts +3 -0
- package/plugin/tsconfig.tsbuildinfo +1 -1
- package/react-native.config.js +3 -28
- package/specs/NativeRNFBTurboCrashlytics.ts +41 -0
- package/typedoc.json +2 -3
- package/dist/module/modular.js +0 -241
- package/dist/module/modular.js.map +0 -1
- package/dist/module/namespaced.js +0 -135
- package/dist/module/namespaced.js.map +0 -1
- package/dist/typescript/lib/modular.d.ts +0 -193
- package/dist/typescript/lib/modular.d.ts.map +0 -1
- package/dist/typescript/lib/namespaced.d.ts +0 -12
- package/dist/typescript/lib/namespaced.d.ts.map +0 -1
- package/lib/modular.ts +0 -249
- package/lib/namespaced.ts +0 -206
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
3
|
+
*
|
|
4
|
+
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
5
|
+
* once the code is regenerated.
|
|
6
|
+
*
|
|
7
|
+
* @generated by codegen project: GenerateModuleCpp.js
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
#include "RNFBCrashlyticsTurboModulesJSI.h"
|
|
11
|
+
|
|
12
|
+
namespace facebook::react {
|
|
13
|
+
|
|
14
|
+
static jsi::Value __hostFunction_NativeRNFBTurboCrashlyticsCxxSpecJSI_getConstants(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
15
|
+
return static_cast<NativeRNFBTurboCrashlyticsCxxSpecJSI *>(&turboModule)->getConstants(
|
|
16
|
+
rt
|
|
17
|
+
);
|
|
18
|
+
}
|
|
19
|
+
static jsi::Value __hostFunction_NativeRNFBTurboCrashlyticsCxxSpecJSI_checkForUnsentReports(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
20
|
+
return static_cast<NativeRNFBTurboCrashlyticsCxxSpecJSI *>(&turboModule)->checkForUnsentReports(
|
|
21
|
+
rt
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
static jsi::Value __hostFunction_NativeRNFBTurboCrashlyticsCxxSpecJSI_crash(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
25
|
+
static_cast<NativeRNFBTurboCrashlyticsCxxSpecJSI *>(&turboModule)->crash(
|
|
26
|
+
rt
|
|
27
|
+
);
|
|
28
|
+
return jsi::Value::undefined();
|
|
29
|
+
}
|
|
30
|
+
static jsi::Value __hostFunction_NativeRNFBTurboCrashlyticsCxxSpecJSI_crashWithStackPromise(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
31
|
+
return static_cast<NativeRNFBTurboCrashlyticsCxxSpecJSI *>(&turboModule)->crashWithStackPromise(
|
|
32
|
+
rt,
|
|
33
|
+
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt)
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
static jsi::Value __hostFunction_NativeRNFBTurboCrashlyticsCxxSpecJSI_deleteUnsentReports(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
37
|
+
return static_cast<NativeRNFBTurboCrashlyticsCxxSpecJSI *>(&turboModule)->deleteUnsentReports(
|
|
38
|
+
rt
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
static jsi::Value __hostFunction_NativeRNFBTurboCrashlyticsCxxSpecJSI_didCrashOnPreviousExecution(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
42
|
+
return static_cast<NativeRNFBTurboCrashlyticsCxxSpecJSI *>(&turboModule)->didCrashOnPreviousExecution(
|
|
43
|
+
rt
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
static jsi::Value __hostFunction_NativeRNFBTurboCrashlyticsCxxSpecJSI_log(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
47
|
+
static_cast<NativeRNFBTurboCrashlyticsCxxSpecJSI *>(&turboModule)->log(
|
|
48
|
+
rt,
|
|
49
|
+
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt)
|
|
50
|
+
);
|
|
51
|
+
return jsi::Value::undefined();
|
|
52
|
+
}
|
|
53
|
+
static jsi::Value __hostFunction_NativeRNFBTurboCrashlyticsCxxSpecJSI_logPromise(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
54
|
+
return static_cast<NativeRNFBTurboCrashlyticsCxxSpecJSI *>(&turboModule)->logPromise(
|
|
55
|
+
rt,
|
|
56
|
+
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt)
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
static jsi::Value __hostFunction_NativeRNFBTurboCrashlyticsCxxSpecJSI_sendUnsentReports(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
60
|
+
static_cast<NativeRNFBTurboCrashlyticsCxxSpecJSI *>(&turboModule)->sendUnsentReports(
|
|
61
|
+
rt
|
|
62
|
+
);
|
|
63
|
+
return jsi::Value::undefined();
|
|
64
|
+
}
|
|
65
|
+
static jsi::Value __hostFunction_NativeRNFBTurboCrashlyticsCxxSpecJSI_setAttribute(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
66
|
+
return static_cast<NativeRNFBTurboCrashlyticsCxxSpecJSI *>(&turboModule)->setAttribute(
|
|
67
|
+
rt,
|
|
68
|
+
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt),
|
|
69
|
+
count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asString(rt)
|
|
70
|
+
);
|
|
71
|
+
}
|
|
72
|
+
static jsi::Value __hostFunction_NativeRNFBTurboCrashlyticsCxxSpecJSI_setAttributes(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
73
|
+
return static_cast<NativeRNFBTurboCrashlyticsCxxSpecJSI *>(&turboModule)->setAttributes(
|
|
74
|
+
rt,
|
|
75
|
+
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt)
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
static jsi::Value __hostFunction_NativeRNFBTurboCrashlyticsCxxSpecJSI_setUserId(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
79
|
+
return static_cast<NativeRNFBTurboCrashlyticsCxxSpecJSI *>(&turboModule)->setUserId(
|
|
80
|
+
rt,
|
|
81
|
+
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt)
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
static jsi::Value __hostFunction_NativeRNFBTurboCrashlyticsCxxSpecJSI_recordError(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
85
|
+
static_cast<NativeRNFBTurboCrashlyticsCxxSpecJSI *>(&turboModule)->recordError(
|
|
86
|
+
rt,
|
|
87
|
+
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt)
|
|
88
|
+
);
|
|
89
|
+
return jsi::Value::undefined();
|
|
90
|
+
}
|
|
91
|
+
static jsi::Value __hostFunction_NativeRNFBTurboCrashlyticsCxxSpecJSI_recordErrorPromise(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
92
|
+
return static_cast<NativeRNFBTurboCrashlyticsCxxSpecJSI *>(&turboModule)->recordErrorPromise(
|
|
93
|
+
rt,
|
|
94
|
+
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt)
|
|
95
|
+
);
|
|
96
|
+
}
|
|
97
|
+
static jsi::Value __hostFunction_NativeRNFBTurboCrashlyticsCxxSpecJSI_setCrashlyticsCollectionEnabled(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
98
|
+
return static_cast<NativeRNFBTurboCrashlyticsCxxSpecJSI *>(&turboModule)->setCrashlyticsCollectionEnabled(
|
|
99
|
+
rt,
|
|
100
|
+
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asBool()
|
|
101
|
+
);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
NativeRNFBTurboCrashlyticsCxxSpecJSI::NativeRNFBTurboCrashlyticsCxxSpecJSI(std::shared_ptr<CallInvoker> jsInvoker)
|
|
105
|
+
: TurboModule("NativeRNFBTurboCrashlytics", jsInvoker) {
|
|
106
|
+
methodMap_["getConstants"] = MethodMetadata {0, __hostFunction_NativeRNFBTurboCrashlyticsCxxSpecJSI_getConstants};
|
|
107
|
+
methodMap_["checkForUnsentReports"] = MethodMetadata {0, __hostFunction_NativeRNFBTurboCrashlyticsCxxSpecJSI_checkForUnsentReports};
|
|
108
|
+
methodMap_["crash"] = MethodMetadata {0, __hostFunction_NativeRNFBTurboCrashlyticsCxxSpecJSI_crash};
|
|
109
|
+
methodMap_["crashWithStackPromise"] = MethodMetadata {1, __hostFunction_NativeRNFBTurboCrashlyticsCxxSpecJSI_crashWithStackPromise};
|
|
110
|
+
methodMap_["deleteUnsentReports"] = MethodMetadata {0, __hostFunction_NativeRNFBTurboCrashlyticsCxxSpecJSI_deleteUnsentReports};
|
|
111
|
+
methodMap_["didCrashOnPreviousExecution"] = MethodMetadata {0, __hostFunction_NativeRNFBTurboCrashlyticsCxxSpecJSI_didCrashOnPreviousExecution};
|
|
112
|
+
methodMap_["log"] = MethodMetadata {1, __hostFunction_NativeRNFBTurboCrashlyticsCxxSpecJSI_log};
|
|
113
|
+
methodMap_["logPromise"] = MethodMetadata {1, __hostFunction_NativeRNFBTurboCrashlyticsCxxSpecJSI_logPromise};
|
|
114
|
+
methodMap_["sendUnsentReports"] = MethodMetadata {0, __hostFunction_NativeRNFBTurboCrashlyticsCxxSpecJSI_sendUnsentReports};
|
|
115
|
+
methodMap_["setAttribute"] = MethodMetadata {2, __hostFunction_NativeRNFBTurboCrashlyticsCxxSpecJSI_setAttribute};
|
|
116
|
+
methodMap_["setAttributes"] = MethodMetadata {1, __hostFunction_NativeRNFBTurboCrashlyticsCxxSpecJSI_setAttributes};
|
|
117
|
+
methodMap_["setUserId"] = MethodMetadata {1, __hostFunction_NativeRNFBTurboCrashlyticsCxxSpecJSI_setUserId};
|
|
118
|
+
methodMap_["recordError"] = MethodMetadata {1, __hostFunction_NativeRNFBTurboCrashlyticsCxxSpecJSI_recordError};
|
|
119
|
+
methodMap_["recordErrorPromise"] = MethodMetadata {1, __hostFunction_NativeRNFBTurboCrashlyticsCxxSpecJSI_recordErrorPromise};
|
|
120
|
+
methodMap_["setCrashlyticsCollectionEnabled"] = MethodMetadata {1, __hostFunction_NativeRNFBTurboCrashlyticsCxxSpecJSI_setCrashlyticsCollectionEnabled};
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
} // namespace facebook::react
|
|
@@ -0,0 +1,320 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
3
|
+
*
|
|
4
|
+
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
5
|
+
* once the code is regenerated.
|
|
6
|
+
*
|
|
7
|
+
* @generated by codegen project: GenerateModuleH.js
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
#pragma once
|
|
11
|
+
|
|
12
|
+
#include <ReactCommon/TurboModule.h>
|
|
13
|
+
#include <react/bridging/Bridging.h>
|
|
14
|
+
|
|
15
|
+
namespace facebook::react {
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
#pragma mark - NativeRNFBTurboCrashlyticsCrashlyticsStackFrame
|
|
20
|
+
|
|
21
|
+
template <typename P0, typename P1, typename P2, typename P3, typename P4>
|
|
22
|
+
struct NativeRNFBTurboCrashlyticsCrashlyticsStackFrame {
|
|
23
|
+
P0 src;
|
|
24
|
+
P1 line;
|
|
25
|
+
P2 col;
|
|
26
|
+
P3 fn;
|
|
27
|
+
P4 file;
|
|
28
|
+
bool operator==(const NativeRNFBTurboCrashlyticsCrashlyticsStackFrame &other) const {
|
|
29
|
+
return src == other.src && line == other.line && col == other.col && fn == other.fn && file == other.file;
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
template <typename T>
|
|
34
|
+
struct NativeRNFBTurboCrashlyticsCrashlyticsStackFrameBridging {
|
|
35
|
+
static T types;
|
|
36
|
+
|
|
37
|
+
static T fromJs(
|
|
38
|
+
jsi::Runtime &rt,
|
|
39
|
+
const jsi::Object &value,
|
|
40
|
+
const std::shared_ptr<CallInvoker> &jsInvoker) {
|
|
41
|
+
T result{
|
|
42
|
+
bridging::fromJs<decltype(types.src)>(rt, value.getProperty(rt, "src"), jsInvoker),
|
|
43
|
+
bridging::fromJs<decltype(types.line)>(rt, value.getProperty(rt, "line"), jsInvoker),
|
|
44
|
+
bridging::fromJs<decltype(types.col)>(rt, value.getProperty(rt, "col"), jsInvoker),
|
|
45
|
+
bridging::fromJs<decltype(types.fn)>(rt, value.getProperty(rt, "fn"), jsInvoker),
|
|
46
|
+
bridging::fromJs<decltype(types.file)>(rt, value.getProperty(rt, "file"), jsInvoker)};
|
|
47
|
+
return result;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
#ifdef DEBUG
|
|
51
|
+
static jsi::String srcToJs(jsi::Runtime &rt, decltype(types.src) value) {
|
|
52
|
+
return bridging::toJs(rt, value);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
static double lineToJs(jsi::Runtime &rt, decltype(types.line) value) {
|
|
56
|
+
return bridging::toJs(rt, value);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
static double colToJs(jsi::Runtime &rt, decltype(types.col) value) {
|
|
60
|
+
return bridging::toJs(rt, value);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
static jsi::String fnToJs(jsi::Runtime &rt, decltype(types.fn) value) {
|
|
64
|
+
return bridging::toJs(rt, value);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
static jsi::String fileToJs(jsi::Runtime &rt, decltype(types.file) value) {
|
|
68
|
+
return bridging::toJs(rt, value);
|
|
69
|
+
}
|
|
70
|
+
#endif
|
|
71
|
+
|
|
72
|
+
static jsi::Object toJs(
|
|
73
|
+
jsi::Runtime &rt,
|
|
74
|
+
const T &value,
|
|
75
|
+
const std::shared_ptr<CallInvoker> &jsInvoker) {
|
|
76
|
+
auto result = facebook::jsi::Object(rt);
|
|
77
|
+
result.setProperty(rt, "src", bridging::toJs(rt, value.src, jsInvoker));
|
|
78
|
+
result.setProperty(rt, "line", bridging::toJs(rt, value.line, jsInvoker));
|
|
79
|
+
result.setProperty(rt, "col", bridging::toJs(rt, value.col, jsInvoker));
|
|
80
|
+
result.setProperty(rt, "fn", bridging::toJs(rt, value.fn, jsInvoker));
|
|
81
|
+
result.setProperty(rt, "file", bridging::toJs(rt, value.file, jsInvoker));
|
|
82
|
+
return result;
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
#pragma mark - NativeRNFBTurboCrashlyticsJavaScriptErrorObject
|
|
89
|
+
|
|
90
|
+
template <typename P0, typename P1, typename P2>
|
|
91
|
+
struct NativeRNFBTurboCrashlyticsJavaScriptErrorObject {
|
|
92
|
+
P0 message;
|
|
93
|
+
P1 isUnhandledRejection;
|
|
94
|
+
P2 frames;
|
|
95
|
+
bool operator==(const NativeRNFBTurboCrashlyticsJavaScriptErrorObject &other) const {
|
|
96
|
+
return message == other.message && isUnhandledRejection == other.isUnhandledRejection && frames == other.frames;
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
template <typename T>
|
|
101
|
+
struct NativeRNFBTurboCrashlyticsJavaScriptErrorObjectBridging {
|
|
102
|
+
static T types;
|
|
103
|
+
|
|
104
|
+
static T fromJs(
|
|
105
|
+
jsi::Runtime &rt,
|
|
106
|
+
const jsi::Object &value,
|
|
107
|
+
const std::shared_ptr<CallInvoker> &jsInvoker) {
|
|
108
|
+
T result{
|
|
109
|
+
bridging::fromJs<decltype(types.message)>(rt, value.getProperty(rt, "message"), jsInvoker),
|
|
110
|
+
bridging::fromJs<decltype(types.isUnhandledRejection)>(rt, value.getProperty(rt, "isUnhandledRejection"), jsInvoker),
|
|
111
|
+
bridging::fromJs<decltype(types.frames)>(rt, value.getProperty(rt, "frames"), jsInvoker)};
|
|
112
|
+
return result;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
#ifdef DEBUG
|
|
116
|
+
static jsi::String messageToJs(jsi::Runtime &rt, decltype(types.message) value) {
|
|
117
|
+
return bridging::toJs(rt, value);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
static bool isUnhandledRejectionToJs(jsi::Runtime &rt, decltype(types.isUnhandledRejection) value) {
|
|
121
|
+
return bridging::toJs(rt, value);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
static jsi::Array framesToJs(jsi::Runtime &rt, decltype(types.frames) value) {
|
|
125
|
+
return bridging::toJs(rt, value);
|
|
126
|
+
}
|
|
127
|
+
#endif
|
|
128
|
+
|
|
129
|
+
static jsi::Object toJs(
|
|
130
|
+
jsi::Runtime &rt,
|
|
131
|
+
const T &value,
|
|
132
|
+
const std::shared_ptr<CallInvoker> &jsInvoker) {
|
|
133
|
+
auto result = facebook::jsi::Object(rt);
|
|
134
|
+
result.setProperty(rt, "message", bridging::toJs(rt, value.message, jsInvoker));
|
|
135
|
+
result.setProperty(rt, "isUnhandledRejection", bridging::toJs(rt, value.isUnhandledRejection, jsInvoker));
|
|
136
|
+
result.setProperty(rt, "frames", bridging::toJs(rt, value.frames, jsInvoker));
|
|
137
|
+
return result;
|
|
138
|
+
}
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
class JSI_EXPORT NativeRNFBTurboCrashlyticsCxxSpecJSI : public TurboModule {
|
|
142
|
+
protected:
|
|
143
|
+
NativeRNFBTurboCrashlyticsCxxSpecJSI(std::shared_ptr<CallInvoker> jsInvoker);
|
|
144
|
+
|
|
145
|
+
public:
|
|
146
|
+
virtual jsi::Object getConstants(jsi::Runtime &rt) = 0;
|
|
147
|
+
virtual jsi::Value checkForUnsentReports(jsi::Runtime &rt) = 0;
|
|
148
|
+
virtual void crash(jsi::Runtime &rt) = 0;
|
|
149
|
+
virtual jsi::Value crashWithStackPromise(jsi::Runtime &rt, jsi::Object jsErrorDict) = 0;
|
|
150
|
+
virtual jsi::Value deleteUnsentReports(jsi::Runtime &rt) = 0;
|
|
151
|
+
virtual jsi::Value didCrashOnPreviousExecution(jsi::Runtime &rt) = 0;
|
|
152
|
+
virtual void log(jsi::Runtime &rt, jsi::String message) = 0;
|
|
153
|
+
virtual jsi::Value logPromise(jsi::Runtime &rt, jsi::String message) = 0;
|
|
154
|
+
virtual void sendUnsentReports(jsi::Runtime &rt) = 0;
|
|
155
|
+
virtual jsi::Value setAttribute(jsi::Runtime &rt, jsi::String key, jsi::String value) = 0;
|
|
156
|
+
virtual jsi::Value setAttributes(jsi::Runtime &rt, jsi::Object attributes) = 0;
|
|
157
|
+
virtual jsi::Value setUserId(jsi::Runtime &rt, jsi::String userId) = 0;
|
|
158
|
+
virtual void recordError(jsi::Runtime &rt, jsi::Object jsErrorDict) = 0;
|
|
159
|
+
virtual jsi::Value recordErrorPromise(jsi::Runtime &rt, jsi::Object jsErrorDict) = 0;
|
|
160
|
+
virtual jsi::Value setCrashlyticsCollectionEnabled(jsi::Runtime &rt, bool enabled) = 0;
|
|
161
|
+
|
|
162
|
+
};
|
|
163
|
+
|
|
164
|
+
template <typename T>
|
|
165
|
+
class JSI_EXPORT NativeRNFBTurboCrashlyticsCxxSpec : public TurboModule {
|
|
166
|
+
public:
|
|
167
|
+
jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override {
|
|
168
|
+
return delegate_.create(rt, propName);
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
std::vector<jsi::PropNameID> getPropertyNames(jsi::Runtime& runtime) override {
|
|
172
|
+
return delegate_.getPropertyNames(runtime);
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
static constexpr std::string_view kModuleName = "NativeRNFBTurboCrashlytics";
|
|
176
|
+
|
|
177
|
+
protected:
|
|
178
|
+
NativeRNFBTurboCrashlyticsCxxSpec(std::shared_ptr<CallInvoker> jsInvoker)
|
|
179
|
+
: TurboModule(std::string{NativeRNFBTurboCrashlyticsCxxSpec::kModuleName}, jsInvoker),
|
|
180
|
+
delegate_(reinterpret_cast<T*>(this), jsInvoker) {}
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
private:
|
|
184
|
+
class Delegate : public NativeRNFBTurboCrashlyticsCxxSpecJSI {
|
|
185
|
+
public:
|
|
186
|
+
Delegate(T *instance, std::shared_ptr<CallInvoker> jsInvoker) :
|
|
187
|
+
NativeRNFBTurboCrashlyticsCxxSpecJSI(std::move(jsInvoker)), instance_(instance) {
|
|
188
|
+
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
jsi::Object getConstants(jsi::Runtime &rt) override {
|
|
192
|
+
static_assert(
|
|
193
|
+
bridging::getParameterCount(&T::getConstants) == 1,
|
|
194
|
+
"Expected getConstants(...) to have 1 parameters");
|
|
195
|
+
|
|
196
|
+
return bridging::callFromJs<jsi::Object>(
|
|
197
|
+
rt, &T::getConstants, jsInvoker_, instance_);
|
|
198
|
+
}
|
|
199
|
+
jsi::Value checkForUnsentReports(jsi::Runtime &rt) override {
|
|
200
|
+
static_assert(
|
|
201
|
+
bridging::getParameterCount(&T::checkForUnsentReports) == 1,
|
|
202
|
+
"Expected checkForUnsentReports(...) to have 1 parameters");
|
|
203
|
+
|
|
204
|
+
return bridging::callFromJs<jsi::Value>(
|
|
205
|
+
rt, &T::checkForUnsentReports, jsInvoker_, instance_);
|
|
206
|
+
}
|
|
207
|
+
void crash(jsi::Runtime &rt) override {
|
|
208
|
+
static_assert(
|
|
209
|
+
bridging::getParameterCount(&T::crash) == 1,
|
|
210
|
+
"Expected crash(...) to have 1 parameters");
|
|
211
|
+
|
|
212
|
+
return bridging::callFromJs<void>(
|
|
213
|
+
rt, &T::crash, jsInvoker_, instance_);
|
|
214
|
+
}
|
|
215
|
+
jsi::Value crashWithStackPromise(jsi::Runtime &rt, jsi::Object jsErrorDict) override {
|
|
216
|
+
static_assert(
|
|
217
|
+
bridging::getParameterCount(&T::crashWithStackPromise) == 2,
|
|
218
|
+
"Expected crashWithStackPromise(...) to have 2 parameters");
|
|
219
|
+
|
|
220
|
+
return bridging::callFromJs<jsi::Value>(
|
|
221
|
+
rt, &T::crashWithStackPromise, jsInvoker_, instance_, std::move(jsErrorDict));
|
|
222
|
+
}
|
|
223
|
+
jsi::Value deleteUnsentReports(jsi::Runtime &rt) override {
|
|
224
|
+
static_assert(
|
|
225
|
+
bridging::getParameterCount(&T::deleteUnsentReports) == 1,
|
|
226
|
+
"Expected deleteUnsentReports(...) to have 1 parameters");
|
|
227
|
+
|
|
228
|
+
return bridging::callFromJs<jsi::Value>(
|
|
229
|
+
rt, &T::deleteUnsentReports, jsInvoker_, instance_);
|
|
230
|
+
}
|
|
231
|
+
jsi::Value didCrashOnPreviousExecution(jsi::Runtime &rt) override {
|
|
232
|
+
static_assert(
|
|
233
|
+
bridging::getParameterCount(&T::didCrashOnPreviousExecution) == 1,
|
|
234
|
+
"Expected didCrashOnPreviousExecution(...) to have 1 parameters");
|
|
235
|
+
|
|
236
|
+
return bridging::callFromJs<jsi::Value>(
|
|
237
|
+
rt, &T::didCrashOnPreviousExecution, jsInvoker_, instance_);
|
|
238
|
+
}
|
|
239
|
+
void log(jsi::Runtime &rt, jsi::String message) override {
|
|
240
|
+
static_assert(
|
|
241
|
+
bridging::getParameterCount(&T::log) == 2,
|
|
242
|
+
"Expected log(...) to have 2 parameters");
|
|
243
|
+
|
|
244
|
+
return bridging::callFromJs<void>(
|
|
245
|
+
rt, &T::log, jsInvoker_, instance_, std::move(message));
|
|
246
|
+
}
|
|
247
|
+
jsi::Value logPromise(jsi::Runtime &rt, jsi::String message) override {
|
|
248
|
+
static_assert(
|
|
249
|
+
bridging::getParameterCount(&T::logPromise) == 2,
|
|
250
|
+
"Expected logPromise(...) to have 2 parameters");
|
|
251
|
+
|
|
252
|
+
return bridging::callFromJs<jsi::Value>(
|
|
253
|
+
rt, &T::logPromise, jsInvoker_, instance_, std::move(message));
|
|
254
|
+
}
|
|
255
|
+
void sendUnsentReports(jsi::Runtime &rt) override {
|
|
256
|
+
static_assert(
|
|
257
|
+
bridging::getParameterCount(&T::sendUnsentReports) == 1,
|
|
258
|
+
"Expected sendUnsentReports(...) to have 1 parameters");
|
|
259
|
+
|
|
260
|
+
return bridging::callFromJs<void>(
|
|
261
|
+
rt, &T::sendUnsentReports, jsInvoker_, instance_);
|
|
262
|
+
}
|
|
263
|
+
jsi::Value setAttribute(jsi::Runtime &rt, jsi::String key, jsi::String value) override {
|
|
264
|
+
static_assert(
|
|
265
|
+
bridging::getParameterCount(&T::setAttribute) == 3,
|
|
266
|
+
"Expected setAttribute(...) to have 3 parameters");
|
|
267
|
+
|
|
268
|
+
return bridging::callFromJs<jsi::Value>(
|
|
269
|
+
rt, &T::setAttribute, jsInvoker_, instance_, std::move(key), std::move(value));
|
|
270
|
+
}
|
|
271
|
+
jsi::Value setAttributes(jsi::Runtime &rt, jsi::Object attributes) override {
|
|
272
|
+
static_assert(
|
|
273
|
+
bridging::getParameterCount(&T::setAttributes) == 2,
|
|
274
|
+
"Expected setAttributes(...) to have 2 parameters");
|
|
275
|
+
|
|
276
|
+
return bridging::callFromJs<jsi::Value>(
|
|
277
|
+
rt, &T::setAttributes, jsInvoker_, instance_, std::move(attributes));
|
|
278
|
+
}
|
|
279
|
+
jsi::Value setUserId(jsi::Runtime &rt, jsi::String userId) override {
|
|
280
|
+
static_assert(
|
|
281
|
+
bridging::getParameterCount(&T::setUserId) == 2,
|
|
282
|
+
"Expected setUserId(...) to have 2 parameters");
|
|
283
|
+
|
|
284
|
+
return bridging::callFromJs<jsi::Value>(
|
|
285
|
+
rt, &T::setUserId, jsInvoker_, instance_, std::move(userId));
|
|
286
|
+
}
|
|
287
|
+
void recordError(jsi::Runtime &rt, jsi::Object jsErrorDict) override {
|
|
288
|
+
static_assert(
|
|
289
|
+
bridging::getParameterCount(&T::recordError) == 2,
|
|
290
|
+
"Expected recordError(...) to have 2 parameters");
|
|
291
|
+
|
|
292
|
+
return bridging::callFromJs<void>(
|
|
293
|
+
rt, &T::recordError, jsInvoker_, instance_, std::move(jsErrorDict));
|
|
294
|
+
}
|
|
295
|
+
jsi::Value recordErrorPromise(jsi::Runtime &rt, jsi::Object jsErrorDict) override {
|
|
296
|
+
static_assert(
|
|
297
|
+
bridging::getParameterCount(&T::recordErrorPromise) == 2,
|
|
298
|
+
"Expected recordErrorPromise(...) to have 2 parameters");
|
|
299
|
+
|
|
300
|
+
return bridging::callFromJs<jsi::Value>(
|
|
301
|
+
rt, &T::recordErrorPromise, jsInvoker_, instance_, std::move(jsErrorDict));
|
|
302
|
+
}
|
|
303
|
+
jsi::Value setCrashlyticsCollectionEnabled(jsi::Runtime &rt, bool enabled) override {
|
|
304
|
+
static_assert(
|
|
305
|
+
bridging::getParameterCount(&T::setCrashlyticsCollectionEnabled) == 2,
|
|
306
|
+
"Expected setCrashlyticsCollectionEnabled(...) to have 2 parameters");
|
|
307
|
+
|
|
308
|
+
return bridging::callFromJs<jsi::Value>(
|
|
309
|
+
rt, &T::setCrashlyticsCollectionEnabled, jsInvoker_, instance_, std::move(enabled));
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
private:
|
|
313
|
+
friend class NativeRNFBTurboCrashlyticsCxxSpec;
|
|
314
|
+
T *instance_;
|
|
315
|
+
};
|
|
316
|
+
|
|
317
|
+
Delegate delegate_;
|
|
318
|
+
};
|
|
319
|
+
|
|
320
|
+
} // namespace facebook::react
|
|
@@ -0,0 +1,34 @@
|
|
|
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.78.3"
|
|
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
|
+
Pod::Spec.new do |s|
|
|
16
|
+
s.name = "ReactAppDependencyProvider"
|
|
17
|
+
s.version = version
|
|
18
|
+
s.summary = "The third party dependency provider for the app"
|
|
19
|
+
s.homepage = "https://reactnative.dev/"
|
|
20
|
+
s.documentation_url = "https://reactnative.dev/"
|
|
21
|
+
s.license = "MIT"
|
|
22
|
+
s.author = "Meta Platforms, Inc. and its affiliates"
|
|
23
|
+
s.platforms = min_supported_versions
|
|
24
|
+
s.source = source
|
|
25
|
+
s.source_files = "**/RCTAppDependencyProvider.{h,mm}"
|
|
26
|
+
|
|
27
|
+
# This guard prevent to install the dependencies when we run `pod install` in the old architecture.
|
|
28
|
+
s.pod_target_xcconfig = {
|
|
29
|
+
"CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard(),
|
|
30
|
+
"DEFINES_MODULE" => "YES"
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
s.dependency "ReactCodegen"
|
|
34
|
+
end
|
package/ios_config.sh
CHANGED
|
@@ -16,10 +16,27 @@
|
|
|
16
16
|
#
|
|
17
17
|
set -e
|
|
18
18
|
|
|
19
|
-
if [[ ${PODS_ROOT} ]]; then
|
|
19
|
+
if [[ ${PODS_ROOT} && -f "${PODS_ROOT}/FirebaseCrashlytics/run" ]]; then
|
|
20
20
|
echo "info: Exec FirebaseCrashlytics Run from Pods"
|
|
21
21
|
"${PODS_ROOT}/FirebaseCrashlytics/run"
|
|
22
|
-
|
|
22
|
+
elif [[ -f "${PROJECT_DIR}/FirebaseCrashlytics.framework/run" ]]; then
|
|
23
23
|
echo "info: Exec FirebaseCrashlytics Run from framework"
|
|
24
24
|
"${PROJECT_DIR}/FirebaseCrashlytics.framework/run"
|
|
25
|
+
else
|
|
26
|
+
# SPM: upload-symbols is at a known path in the SourcePackages checkout.
|
|
27
|
+
# BUILD_DIR is typically DerivedData/Project-hash/Build/Products — strip from /Build onward
|
|
28
|
+
# to get the DerivedData project root where SourcePackages lives.
|
|
29
|
+
SPM_CRASHLYTICS_DIR="${BUILD_DIR%Build/*}SourcePackages/checkouts/firebase-ios-sdk/Crashlytics"
|
|
30
|
+
SPM_UPLOAD_SYMBOLS="${SPM_CRASHLYTICS_DIR}/upload-symbols"
|
|
31
|
+
if [[ -x "${SPM_UPLOAD_SYMBOLS}" ]]; then
|
|
32
|
+
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}"
|
|
34
|
+
elif [[ -f "${SPM_UPLOAD_SYMBOLS}" ]]; then
|
|
35
|
+
echo "info: Exec FirebaseCrashlytics upload-symbols from SPM (chmod +x)"
|
|
36
|
+
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}"
|
|
38
|
+
else
|
|
39
|
+
echo "warning: FirebaseCrashlytics run script not found at CocoaPods, framework, or SPM paths. Skipping dSYM upload."
|
|
40
|
+
echo "warning: Checked: \${PODS_ROOT}/FirebaseCrashlytics/run, \${PROJECT_DIR}/FirebaseCrashlytics.framework/run, ${SPM_UPLOAD_SYMBOLS}"
|
|
41
|
+
fi
|
|
25
42
|
fi
|
package/lib/handlers.ts
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
|
-
import {
|
|
18
|
+
import { getApp } from '@react-native-firebase/app';
|
|
19
19
|
import { isError, once } from '@react-native-firebase/app/dist/module/common';
|
|
20
20
|
// @ts-ignore - No declaration file for promise/setimmediate/rejection-tracking
|
|
21
21
|
import tracking from 'promise/setimmediate/rejection-tracking';
|
|
@@ -125,35 +125,16 @@ export const setGlobalErrorHandler = once((nativeModule: NativeModule) => {
|
|
|
125
125
|
// Flag the Crashlytics backend that we have a fatal error, they will transform it
|
|
126
126
|
await nativeModule.setAttribute(FATAL_FLAG, fatalTime);
|
|
127
127
|
|
|
128
|
-
// remember our current deprecation warning state in case users
|
|
129
|
-
// have set it to non-default
|
|
130
|
-
const currentDeprecationWarningToggle =
|
|
131
|
-
globalThis.RNFB_SILENCE_MODULAR_DEPRECATION_WARNINGS;
|
|
132
|
-
|
|
133
|
-
// Notify analytics, if it exists - throws error if not
|
|
134
128
|
try {
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
globalThis.RNFB_SILENCE_MODULAR_DEPRECATION_WARNINGS = true;
|
|
141
|
-
// @ts-ignore - analytics types not available in crashlytics
|
|
142
|
-
await firebase.app().analytics().logEvent(
|
|
143
|
-
'app_exception', // 'app_exception' is reserved but we make an exception for JS->fatal transforms
|
|
144
|
-
{
|
|
145
|
-
fatal: 1, // as in firebase-android-sdk
|
|
146
|
-
timestamp: fatalTime,
|
|
147
|
-
},
|
|
148
|
-
);
|
|
129
|
+
const { getAnalytics, logEvent } = require('@react-native-firebase/analytics');
|
|
130
|
+
await logEvent(getAnalytics(getApp()), 'app_exception', {
|
|
131
|
+
fatal: 1,
|
|
132
|
+
timestamp: fatalTime,
|
|
133
|
+
});
|
|
149
134
|
} catch (_) {
|
|
150
|
-
//
|
|
151
|
-
// console.log('error logging analytics app_exception: ' + e);
|
|
152
|
-
} finally {
|
|
153
|
-
globalThis.RNFB_SILENCE_MODULAR_DEPRECATION_WARNINGS = currentDeprecationWarningToggle;
|
|
135
|
+
// analytics not present
|
|
154
136
|
}
|
|
155
137
|
|
|
156
|
-
// If we are chaining to other handlers, just record the error, otherwise we need to crash with it
|
|
157
138
|
if (nativeModule.isCrashlyticsJavascriptExceptionHandlerChainingEnabled) {
|
|
158
139
|
await nativeModule.recordErrorPromise(createNativeErrorObj(error, stackFrames, false));
|
|
159
140
|
} else {
|