@react-native-firebase/crashlytics 26.2.0 → 26.3.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.
@@ -15,15 +15,14 @@
15
15
  namespace facebook::react {
16
16
 
17
17
 
18
-
19
18
  #pragma mark - NativeRNFBTurboCrashlyticsCrashlyticsStackFrame
20
19
 
21
20
  template <typename P0, typename P1, typename P2, typename P3, typename P4>
22
21
  struct NativeRNFBTurboCrashlyticsCrashlyticsStackFrame {
23
- P0 src;
24
- P1 line;
25
- P2 col;
26
- P3 fn;
22
+ P0 src{};
23
+ P1 line{};
24
+ P2 col{};
25
+ P3 fn{};
27
26
  P4 file;
28
27
  bool operator==(const NativeRNFBTurboCrashlyticsCrashlyticsStackFrame &other) const {
29
28
  return src == other.src && line == other.line && col == other.col && fn == other.fn && file == other.file;
@@ -51,19 +50,15 @@ struct NativeRNFBTurboCrashlyticsCrashlyticsStackFrameBridging {
51
50
  static jsi::String srcToJs(jsi::Runtime &rt, decltype(types.src) value) {
52
51
  return bridging::toJs(rt, value);
53
52
  }
54
-
55
53
  static double lineToJs(jsi::Runtime &rt, decltype(types.line) value) {
56
54
  return bridging::toJs(rt, value);
57
55
  }
58
-
59
56
  static double colToJs(jsi::Runtime &rt, decltype(types.col) value) {
60
57
  return bridging::toJs(rt, value);
61
58
  }
62
-
63
59
  static jsi::String fnToJs(jsi::Runtime &rt, decltype(types.fn) value) {
64
60
  return bridging::toJs(rt, value);
65
61
  }
66
-
67
62
  static jsi::String fileToJs(jsi::Runtime &rt, decltype(types.file) value) {
68
63
  return bridging::toJs(rt, value);
69
64
  }
@@ -89,8 +84,8 @@ struct NativeRNFBTurboCrashlyticsCrashlyticsStackFrameBridging {
89
84
 
90
85
  template <typename P0, typename P1, typename P2>
91
86
  struct NativeRNFBTurboCrashlyticsJavaScriptErrorObject {
92
- P0 message;
93
- P1 isUnhandledRejection;
87
+ P0 message{};
88
+ P1 isUnhandledRejection{};
94
89
  P2 frames;
95
90
  bool operator==(const NativeRNFBTurboCrashlyticsJavaScriptErrorObject &other) const {
96
91
  return message == other.message && isUnhandledRejection == other.isUnhandledRejection && frames == other.frames;
@@ -116,11 +111,9 @@ struct NativeRNFBTurboCrashlyticsJavaScriptErrorObjectBridging {
116
111
  static jsi::String messageToJs(jsi::Runtime &rt, decltype(types.message) value) {
117
112
  return bridging::toJs(rt, value);
118
113
  }
119
-
120
114
  static bool isUnhandledRejectionToJs(jsi::Runtime &rt, decltype(types.isUnhandledRejection) value) {
121
115
  return bridging::toJs(rt, value);
122
116
  }
123
-
124
117
  static jsi::Array framesToJs(jsi::Runtime &rt, decltype(types.frames) value) {
125
118
  return bridging::toJs(rt, value);
126
119
  }
@@ -138,183 +131,146 @@ struct NativeRNFBTurboCrashlyticsJavaScriptErrorObjectBridging {
138
131
  }
139
132
  };
140
133
 
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
134
 
164
135
  template <typename T>
165
136
  class JSI_EXPORT NativeRNFBTurboCrashlyticsCxxSpec : public TurboModule {
166
137
  public:
167
- jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override {
168
- return delegate_.create(rt, propName);
138
+ static constexpr std::string_view kModuleName = "NativeRNFBTurboCrashlytics";
139
+
140
+ protected:
141
+ NativeRNFBTurboCrashlyticsCxxSpec(std::shared_ptr<CallInvoker> jsInvoker) : TurboModule(std::string{NativeRNFBTurboCrashlyticsCxxSpec::kModuleName}, jsInvoker) {
142
+ methodMap_["getConstants"] = MethodMetadata {.argCount = 0, .invoker = __getConstants};
143
+ methodMap_["checkForUnsentReports"] = MethodMetadata {.argCount = 0, .invoker = __checkForUnsentReports};
144
+ methodMap_["crash"] = MethodMetadata {.argCount = 0, .invoker = __crash};
145
+ methodMap_["crashWithStackPromise"] = MethodMetadata {.argCount = 1, .invoker = __crashWithStackPromise};
146
+ methodMap_["deleteUnsentReports"] = MethodMetadata {.argCount = 0, .invoker = __deleteUnsentReports};
147
+ methodMap_["didCrashOnPreviousExecution"] = MethodMetadata {.argCount = 0, .invoker = __didCrashOnPreviousExecution};
148
+ methodMap_["log"] = MethodMetadata {.argCount = 1, .invoker = __log};
149
+ methodMap_["logPromise"] = MethodMetadata {.argCount = 1, .invoker = __logPromise};
150
+ methodMap_["sendUnsentReports"] = MethodMetadata {.argCount = 0, .invoker = __sendUnsentReports};
151
+ methodMap_["setAttribute"] = MethodMetadata {.argCount = 2, .invoker = __setAttribute};
152
+ methodMap_["setAttributes"] = MethodMetadata {.argCount = 1, .invoker = __setAttributes};
153
+ methodMap_["setUserId"] = MethodMetadata {.argCount = 1, .invoker = __setUserId};
154
+ methodMap_["recordError"] = MethodMetadata {.argCount = 1, .invoker = __recordError};
155
+ methodMap_["recordErrorPromise"] = MethodMetadata {.argCount = 1, .invoker = __recordErrorPromise};
156
+ methodMap_["setCrashlyticsCollectionEnabled"] = MethodMetadata {.argCount = 1, .invoker = __setCrashlyticsCollectionEnabled};
157
+ }
158
+
159
+ private:
160
+ static jsi::Value __getConstants(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* /*args*/, size_t /*count*/) {
161
+ static_assert(
162
+ bridging::getParameterCount(&T::getConstants) == 1,
163
+ "Expected getConstants(...) to have 1 parameters");
164
+ return bridging::callFromJs<jsi::Object>(rt, &T::getConstants, static_cast<NativeRNFBTurboCrashlyticsCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule));
169
165
  }
170
166
 
171
- std::vector<jsi::PropNameID> getPropertyNames(jsi::Runtime& runtime) override {
172
- return delegate_.getPropertyNames(runtime);
167
+ static jsi::Value __checkForUnsentReports(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* /*args*/, size_t /*count*/) {
168
+ static_assert(
169
+ bridging::getParameterCount(&T::checkForUnsentReports) == 1,
170
+ "Expected checkForUnsentReports(...) to have 1 parameters");
171
+ return bridging::callFromJs<jsi::Value>(rt, &T::checkForUnsentReports, static_cast<NativeRNFBTurboCrashlyticsCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule));
173
172
  }
174
173
 
175
- static constexpr std::string_view kModuleName = "NativeRNFBTurboCrashlytics";
174
+ static jsi::Value __crash(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* /*args*/, size_t /*count*/) {
175
+ static_assert(
176
+ bridging::getParameterCount(&T::crash) == 1,
177
+ "Expected crash(...) to have 1 parameters");
178
+ bridging::callFromJs<void>(rt, &T::crash, static_cast<NativeRNFBTurboCrashlyticsCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule));return jsi::Value::undefined();
179
+ }
176
180
 
177
- protected:
178
- NativeRNFBTurboCrashlyticsCxxSpec(std::shared_ptr<CallInvoker> jsInvoker)
179
- : TurboModule(std::string{NativeRNFBTurboCrashlyticsCxxSpec::kModuleName}, jsInvoker),
180
- delegate_(reinterpret_cast<T*>(this), jsInvoker) {}
181
+ static jsi::Value __crashWithStackPromise(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
182
+ static_assert(
183
+ bridging::getParameterCount(&T::crashWithStackPromise) == 2,
184
+ "Expected crashWithStackPromise(...) to have 2 parameters");
185
+ return bridging::callFromJs<jsi::Value>(rt, &T::crashWithStackPromise, static_cast<NativeRNFBTurboCrashlyticsCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule),
186
+ count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt));
187
+ }
181
188
 
189
+ static jsi::Value __deleteUnsentReports(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* /*args*/, size_t /*count*/) {
190
+ static_assert(
191
+ bridging::getParameterCount(&T::deleteUnsentReports) == 1,
192
+ "Expected deleteUnsentReports(...) to have 1 parameters");
193
+ return bridging::callFromJs<jsi::Value>(rt, &T::deleteUnsentReports, static_cast<NativeRNFBTurboCrashlyticsCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule));
194
+ }
182
195
 
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_;
196
+ static jsi::Value __didCrashOnPreviousExecution(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* /*args*/, size_t /*count*/) {
197
+ static_assert(
198
+ bridging::getParameterCount(&T::didCrashOnPreviousExecution) == 1,
199
+ "Expected didCrashOnPreviousExecution(...) to have 1 parameters");
200
+ return bridging::callFromJs<jsi::Value>(rt, &T::didCrashOnPreviousExecution, static_cast<NativeRNFBTurboCrashlyticsCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule));
201
+ }
202
+
203
+ static jsi::Value __log(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
204
+ static_assert(
205
+ bridging::getParameterCount(&T::log) == 2,
206
+ "Expected log(...) to have 2 parameters");
207
+ bridging::callFromJs<void>(rt, &T::log, static_cast<NativeRNFBTurboCrashlyticsCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule),
208
+ count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt));return jsi::Value::undefined();
209
+ }
210
+
211
+ static jsi::Value __logPromise(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
212
+ static_assert(
213
+ bridging::getParameterCount(&T::logPromise) == 2,
214
+ "Expected logPromise(...) to have 2 parameters");
215
+ return bridging::callFromJs<jsi::Value>(rt, &T::logPromise, static_cast<NativeRNFBTurboCrashlyticsCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule),
216
+ count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt));
217
+ }
218
+
219
+ static jsi::Value __sendUnsentReports(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* /*args*/, size_t /*count*/) {
220
+ static_assert(
221
+ bridging::getParameterCount(&T::sendUnsentReports) == 1,
222
+ "Expected sendUnsentReports(...) to have 1 parameters");
223
+ bridging::callFromJs<void>(rt, &T::sendUnsentReports, static_cast<NativeRNFBTurboCrashlyticsCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule));return jsi::Value::undefined();
224
+ }
225
+
226
+ static jsi::Value __setAttribute(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
227
+ static_assert(
228
+ bridging::getParameterCount(&T::setAttribute) == 3,
229
+ "Expected setAttribute(...) to have 3 parameters");
230
+ return bridging::callFromJs<jsi::Value>(rt, &T::setAttribute, static_cast<NativeRNFBTurboCrashlyticsCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule),
231
+ count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt),
232
+ count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asString(rt));
233
+ }
234
+
235
+ static jsi::Value __setAttributes(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
236
+ static_assert(
237
+ bridging::getParameterCount(&T::setAttributes) == 2,
238
+ "Expected setAttributes(...) to have 2 parameters");
239
+ return bridging::callFromJs<jsi::Value>(rt, &T::setAttributes, static_cast<NativeRNFBTurboCrashlyticsCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule),
240
+ count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt));
241
+ }
242
+
243
+ static jsi::Value __setUserId(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
244
+ static_assert(
245
+ bridging::getParameterCount(&T::setUserId) == 2,
246
+ "Expected setUserId(...) to have 2 parameters");
247
+ return bridging::callFromJs<jsi::Value>(rt, &T::setUserId, static_cast<NativeRNFBTurboCrashlyticsCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule),
248
+ count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt));
249
+ }
250
+
251
+ static jsi::Value __recordError(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
252
+ static_assert(
253
+ bridging::getParameterCount(&T::recordError) == 2,
254
+ "Expected recordError(...) to have 2 parameters");
255
+ bridging::callFromJs<void>(rt, &T::recordError, static_cast<NativeRNFBTurboCrashlyticsCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule),
256
+ count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt));return jsi::Value::undefined();
257
+ }
258
+
259
+ static jsi::Value __recordErrorPromise(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
260
+ static_assert(
261
+ bridging::getParameterCount(&T::recordErrorPromise) == 2,
262
+ "Expected recordErrorPromise(...) to have 2 parameters");
263
+ return bridging::callFromJs<jsi::Value>(rt, &T::recordErrorPromise, static_cast<NativeRNFBTurboCrashlyticsCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule),
264
+ count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt));
265
+ }
266
+
267
+ static jsi::Value __setCrashlyticsCollectionEnabled(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
268
+ static_assert(
269
+ bridging::getParameterCount(&T::setCrashlyticsCollectionEnabled) == 2,
270
+ "Expected setCrashlyticsCollectionEnabled(...) to have 2 parameters");
271
+ return bridging::callFromJs<jsi::Value>(rt, &T::setCrashlyticsCollectionEnabled, static_cast<NativeRNFBTurboCrashlyticsCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule),
272
+ count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asBool());
273
+ }
318
274
  };
319
275
 
320
276
  } // namespace facebook::react
package/lib/version.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  // Generated by genversion.
2
- export const version = '26.2.0';
2
+ export const version = '26.3.0';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-native-firebase/crashlytics",
3
- "version": "26.2.0",
3
+ "version": "26.3.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",
@@ -27,8 +27,8 @@
27
27
  "compile": "bob build",
28
28
  "prepare": "yarn run build && yarn run build:plugin && yarn compile",
29
29
  "codegen": "yarn android:codegen && yarn ios:codegen",
30
- "android:codegen": "rimraf android/src/main/java/io/invertase/firebase/crashlytics/generated && npx @react-native-community/cli codegen --platform android --outputPath=./android/src/main/java/io/invertase/firebase/crashlytics/generated",
31
- "ios:codegen": "rimraf ios/generated && npx @react-native-community/cli codegen --platform ios --outputPath=./ios/generated"
30
+ "android:codegen": "node ../../scripts/codegen-package.mjs crashlytics android",
31
+ "ios:codegen": "node ../../scripts/codegen-package.mjs crashlytics ios"
32
32
  },
33
33
  "repository": {
34
34
  "type": "git",
@@ -47,14 +47,14 @@
47
47
  "crashlytics"
48
48
  ],
49
49
  "peerDependencies": {
50
- "@react-native-firebase/app": "26.2.0",
50
+ "@react-native-firebase/app": "26.3.0",
51
51
  "expo": ">=47.0.0"
52
52
  },
53
53
  "dependencies": {
54
54
  "stacktrace-js": "^2.0.2"
55
55
  },
56
56
  "devDependencies": {
57
- "@react-native-firebase/app": "26.2.0",
57
+ "@react-native-firebase/app": "26.3.0",
58
58
  "expo": "^55.0.18",
59
59
  "react-native-builder-bob": "^0.41.0",
60
60
  "typescript": "^6.0.3"
@@ -102,5 +102,5 @@
102
102
  ]
103
103
  ]
104
104
  },
105
- "gitHead": "b7efa8ca2781b5102975ee5169ee6fc52e9c1588"
105
+ "gitHead": "12a52d40c0d156d05a16f4b49eb0e507c0f5d8c5"
106
106
  }
@@ -1,124 +0,0 @@
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
@@ -1,25 +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
-
9
- #import <Foundation/Foundation.h>
10
-
11
- #if __has_include(<React-RCTAppDelegate/RCTDependencyProvider.h>)
12
- #import <React-RCTAppDelegate/RCTDependencyProvider.h>
13
- #elif __has_include(<React_RCTAppDelegate/RCTDependencyProvider.h>)
14
- #import <React_RCTAppDelegate/RCTDependencyProvider.h>
15
- #else
16
- #import "RCTDependencyProvider.h"
17
- #endif
18
-
19
- NS_ASSUME_NONNULL_BEGIN
20
-
21
- @interface RCTAppDependencyProvider : NSObject <RCTDependencyProvider>
22
-
23
- @end
24
-
25
- NS_ASSUME_NONNULL_END
@@ -1,55 +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 "RCTAppDependencyProvider.h"
9
- #import <ReactCodegen/RCTModulesConformingToProtocolsProvider.h>
10
- #import <ReactCodegen/RCTThirdPartyComponentsProvider.h>
11
-
12
- @implementation RCTAppDependencyProvider {
13
- NSArray<NSString *> * _URLRequestHandlerClassNames;
14
- NSArray<NSString *> * _imageDataDecoderClassNames;
15
- NSArray<NSString *> * _imageURLLoaderClassNames;
16
- NSDictionary<NSString *,Class<RCTComponentViewProtocol>> * _thirdPartyFabricComponents;
17
- }
18
-
19
- - (nonnull NSArray<NSString *> *)URLRequestHandlerClassNames {
20
- static dispatch_once_t requestUrlToken;
21
- dispatch_once(&requestUrlToken, ^{
22
- self->_URLRequestHandlerClassNames = RCTModulesConformingToProtocolsProvider.URLRequestHandlerClassNames;
23
- });
24
-
25
- return _URLRequestHandlerClassNames;
26
- }
27
-
28
- - (nonnull NSArray<NSString *> *)imageDataDecoderClassNames {
29
- static dispatch_once_t dataDecoderToken;
30
- dispatch_once(&dataDecoderToken, ^{
31
- _imageDataDecoderClassNames = RCTModulesConformingToProtocolsProvider.imageDataDecoderClassNames;
32
- });
33
-
34
- return _imageDataDecoderClassNames;
35
- }
36
-
37
- - (nonnull NSArray<NSString *> *)imageURLLoaderClassNames {
38
- static dispatch_once_t urlLoaderToken;
39
- dispatch_once(&urlLoaderToken, ^{
40
- _imageURLLoaderClassNames = RCTModulesConformingToProtocolsProvider.imageURLLoaderClassNames;
41
- });
42
-
43
- return _imageURLLoaderClassNames;
44
- }
45
-
46
- - (nonnull NSDictionary<NSString *,Class<RCTComponentViewProtocol>> *)thirdPartyFabricComponents {
47
- static dispatch_once_t nativeComponentsToken;
48
- dispatch_once(&nativeComponentsToken, ^{
49
- _thirdPartyFabricComponents = RCTThirdPartyComponentsProvider.thirdPartyFabricComponents;
50
- });
51
-
52
- return _thirdPartyFabricComponents;
53
- }
54
-
55
- @end