@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.
Files changed (70) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/RNFBCrashlytics.podspec +22 -8
  3. package/android/build.gradle +23 -0
  4. package/android/src/main/java/io/invertase/firebase/crashlytics/{ReactNativeFirebaseCrashlyticsModule.java → NativeRNFBTurboCrashlytics.java} +44 -39
  5. package/android/src/main/java/io/invertase/firebase/crashlytics/ReactNativeFirebaseCrashlyticsPackage.java +1 -1
  6. package/android/src/main/java/io/invertase/firebase/crashlytics/generated/java/com/facebook/fbreact/specs/NativeRNFBTurboCrashlyticsSpec.java +125 -0
  7. package/android/src/main/java/io/invertase/firebase/crashlytics/generated/jni/CMakeLists.txt +36 -0
  8. package/android/src/main/java/io/invertase/firebase/crashlytics/generated/jni/RNFBCrashlyticsTurboModules-generated.cpp +116 -0
  9. package/android/src/main/java/io/invertase/firebase/crashlytics/generated/jni/RNFBCrashlyticsTurboModules.h +31 -0
  10. package/android/src/main/java/io/invertase/firebase/crashlytics/generated/jni/react/renderer/components/RNFBCrashlyticsTurboModules/RNFBCrashlyticsTurboModulesJSI-generated.cpp +124 -0
  11. package/android/src/main/java/io/invertase/firebase/crashlytics/generated/jni/react/renderer/components/RNFBCrashlyticsTurboModules/RNFBCrashlyticsTurboModulesJSI.h +320 -0
  12. package/app.plugin.js +1 -1
  13. package/dist/module/handlers.js +7 -24
  14. package/dist/module/handlers.js.map +1 -1
  15. package/dist/module/index.js +125 -8
  16. package/dist/module/index.js.map +1 -1
  17. package/dist/module/types/crashlytics.js +1 -40
  18. package/dist/module/types/crashlytics.js.map +1 -1
  19. package/dist/module/types/internal.js +4 -0
  20. package/dist/module/types/internal.js.map +1 -0
  21. package/dist/module/version.js +1 -1
  22. package/dist/typescript/lib/handlers.d.ts.map +1 -1
  23. package/dist/typescript/lib/index.d.ts +19 -4
  24. package/dist/typescript/lib/index.d.ts.map +1 -1
  25. package/dist/typescript/lib/types/crashlytics.d.ts +0 -21
  26. package/dist/typescript/lib/types/crashlytics.d.ts.map +1 -1
  27. package/dist/typescript/lib/types/internal.d.ts +44 -0
  28. package/dist/typescript/lib/types/internal.d.ts.map +1 -0
  29. package/dist/typescript/lib/version.d.ts +1 -1
  30. package/ios/RNFBCrashlytics/RNFBCrashlyticsInitProvider.h +15 -6
  31. package/ios/RNFBCrashlytics/RNFBCrashlyticsInitProvider.m +24 -1
  32. package/ios/RNFBCrashlytics/RNFBCrashlyticsModule.h +2 -3
  33. package/ios/RNFBCrashlytics/{RNFBCrashlyticsModule.m → RNFBCrashlyticsModule.mm} +72 -72
  34. package/ios/RNFBCrashlytics/RNFBCrashlyticsNativeHelper.m +8 -0
  35. package/ios/RNFBCrashlytics.xcodeproj/project.pbxproj +8 -8
  36. package/ios/generated/RCTAppDependencyProvider.h +25 -0
  37. package/ios/generated/RCTAppDependencyProvider.mm +55 -0
  38. package/ios/generated/RCTModulesConformingToProtocolsProvider.h +18 -0
  39. package/ios/generated/RCTModulesConformingToProtocolsProvider.mm +33 -0
  40. package/ios/generated/RCTThirdPartyComponentsProvider.h +16 -0
  41. package/ios/generated/RCTThirdPartyComponentsProvider.mm +23 -0
  42. package/ios/generated/RNFBCrashlyticsTurboModules/RNFBCrashlyticsTurboModules-generated.mm +148 -0
  43. package/ios/generated/RNFBCrashlyticsTurboModules/RNFBCrashlyticsTurboModules.h +214 -0
  44. package/ios/generated/RNFBCrashlyticsTurboModulesJSI-generated.cpp +124 -0
  45. package/ios/generated/RNFBCrashlyticsTurboModulesJSI.h +320 -0
  46. package/ios/generated/ReactAppDependencyProvider.podspec +34 -0
  47. package/ios_config.sh +19 -2
  48. package/lib/handlers.ts +7 -26
  49. package/lib/index.ts +209 -7
  50. package/lib/types/crashlytics.ts +0 -30
  51. package/lib/types/internal.ts +59 -0
  52. package/lib/version.ts +1 -1
  53. package/package.json +30 -5
  54. package/plugin/build/app.plugin.d.ts +2 -0
  55. package/plugin/build/app.plugin.js +6 -0
  56. package/plugin/src/app.plugin.ts +3 -0
  57. package/plugin/tsconfig.tsbuildinfo +1 -1
  58. package/react-native.config.js +3 -28
  59. package/specs/NativeRNFBTurboCrashlytics.ts +41 -0
  60. package/typedoc.json +2 -3
  61. package/dist/module/modular.js +0 -241
  62. package/dist/module/modular.js.map +0 -1
  63. package/dist/module/namespaced.js +0 -135
  64. package/dist/module/namespaced.js.map +0 -1
  65. package/dist/typescript/lib/modular.d.ts +0 -193
  66. package/dist/typescript/lib/modular.d.ts.map +0 -1
  67. package/dist/typescript/lib/namespaced.d.ts +0 -12
  68. package/dist/typescript/lib/namespaced.d.ts.map +0 -1
  69. package/lib/modular.ts +0 -249
  70. package/lib/namespaced.ts +0 -206
package/lib/index.ts CHANGED
@@ -1,3 +1,4 @@
1
+ /* eslint-disable no-console */
1
2
  /*
2
3
  * Copyright (c) 2016-present Invertase Limited & Contributors
3
4
  *
@@ -15,12 +16,213 @@
15
16
  *
16
17
  */
17
18
 
18
- // Export types from types/crashlytics
19
- export type { Crashlytics, FirebaseCrashlyticsTypes } from './types/crashlytics';
19
+ import type { FirebaseApp } from '@react-native-firebase/app';
20
+ import {
21
+ isBoolean,
22
+ isError,
23
+ isObject,
24
+ isString,
25
+ } from '@react-native-firebase/app/dist/module/common';
26
+ import {
27
+ FirebaseModule,
28
+ getOrCreateModularInstance,
29
+ } from '@react-native-firebase/app/dist/module/internal';
30
+ import type { ModuleConfig } from '@react-native-firebase/app/dist/module/internal';
31
+ import './types/internal';
32
+ import StackTrace from 'stacktrace-js';
33
+ import {
34
+ createNativeErrorObj,
35
+ setGlobalErrorHandler,
36
+ setOnUnhandledPromiseRejectionHandler,
37
+ } from './handlers';
38
+ import { version } from './version';
39
+ import type { Crashlytics } from './types/crashlytics';
40
+ import type { CrashlyticsInternal } from './types/internal';
41
+ import type { ReactNativeFirebase } from '@react-native-firebase/app';
20
42
 
21
- // Export modular API functions
22
- export * from './modular';
43
+ const nativeModuleName = 'NativeRNFBTurboCrashlytics';
23
44
 
24
- // Export namespaced API
25
- export * from './namespaced';
26
- export { default } from './namespaced';
45
+ class FirebaseCrashlyticsModule extends FirebaseModule {
46
+ _isCrashlyticsCollectionEnabled: boolean;
47
+
48
+ constructor(
49
+ app: ReactNativeFirebase.FirebaseAppBase,
50
+ config: ModuleConfig,
51
+ customUrlOrRegion?: string | null,
52
+ ) {
53
+ super(app, config, customUrlOrRegion);
54
+ setGlobalErrorHandler(this.native);
55
+ setOnUnhandledPromiseRejectionHandler(this.native);
56
+ this._isCrashlyticsCollectionEnabled = this.native.isCrashlyticsCollectionEnabled;
57
+ }
58
+
59
+ get isCrashlyticsCollectionEnabled(): boolean {
60
+ // Purposefully did not deprecate this as I think it should remain a property rather than a method.
61
+ return this._isCrashlyticsCollectionEnabled;
62
+ }
63
+
64
+ checkForUnsentReports(): Promise<boolean> {
65
+ if (this.isCrashlyticsCollectionEnabled) {
66
+ throw new Error(
67
+ "firebase.crashlytics().setCrashlyticsCollectionEnabled(*) has been set to 'true', all reports are automatically sent.",
68
+ );
69
+ }
70
+ return this.native.checkForUnsentReports();
71
+ }
72
+
73
+ crash(): void {
74
+ this.native.crash();
75
+ }
76
+
77
+ async deleteUnsentReports(): Promise<void> {
78
+ await this.native.deleteUnsentReports();
79
+ }
80
+
81
+ didCrashOnPreviousExecution(): Promise<boolean> {
82
+ return this.native.didCrashOnPreviousExecution();
83
+ }
84
+
85
+ log(message: string): void {
86
+ this.native.log(`${message}`);
87
+ }
88
+
89
+ setAttribute(name: string, value: string): Promise<null> {
90
+ if (!isString(name)) {
91
+ throw new Error(
92
+ 'firebase.crashlytics().setAttribute(*, _): The supplied property name must be a string.',
93
+ );
94
+ }
95
+
96
+ if (!isString(value)) {
97
+ throw new Error(
98
+ 'firebase.crashlytics().setAttribute(_, *): The supplied property value must be a string value.',
99
+ );
100
+ }
101
+
102
+ return this.native.setAttribute(name, value);
103
+ }
104
+
105
+ setAttributes(object: { [key: string]: string }): Promise<null> {
106
+ if (!isObject(object)) {
107
+ throw new Error(
108
+ 'firebase.crashlytics().setAttributes(*): The supplied arg must be an object of key value strings.',
109
+ );
110
+ }
111
+
112
+ return this.native.setAttributes(object);
113
+ }
114
+
115
+ setUserId(userId: string): Promise<null> {
116
+ if (!isString(userId)) {
117
+ throw new Error(
118
+ 'firebase.crashlytics().setUserId(*): The supplied userId must be a string value.',
119
+ );
120
+ }
121
+
122
+ return this.native.setUserId(userId);
123
+ }
124
+
125
+ recordError(error: Error, jsErrorName?: string): void {
126
+ if (isError(error)) {
127
+ StackTrace.fromError(error, { offline: true })
128
+ .then(stackFrames =>
129
+ this.native.recordErrorPromise(
130
+ createNativeErrorObj(error, stackFrames, false, jsErrorName),
131
+ ),
132
+ )
133
+ .catch(() => {});
134
+ } else {
135
+ console.warn(
136
+ 'firebase.crashlytics().recordError(*) expects an instance of Error. Non Errors will be ignored.',
137
+ );
138
+ }
139
+ }
140
+
141
+ sendUnsentReports(): void {
142
+ if (this.isCrashlyticsCollectionEnabled) {
143
+ this.native.sendUnsentReports();
144
+ }
145
+ }
146
+
147
+ setCrashlyticsCollectionEnabled(enabled: boolean): Promise<null> {
148
+ if (!isBoolean(enabled)) {
149
+ throw new Error(
150
+ "firebase.crashlytics().setCrashlyticsCollectionEnabled(*) 'enabled' must be a boolean.",
151
+ );
152
+ }
153
+
154
+ this._isCrashlyticsCollectionEnabled = enabled;
155
+ return this.native.setCrashlyticsCollectionEnabled(enabled);
156
+ }
157
+ }
158
+
159
+ const config: ModuleConfig = {
160
+ namespace: 'crashlytics',
161
+ nativeModuleName,
162
+ nativeEvents: false,
163
+ hasMultiAppSupport: false,
164
+ hasCustomUrlOrRegionSupport: false,
165
+ turboModule: true,
166
+ };
167
+
168
+ export const SDK_VERSION = version;
169
+
170
+ export function getCrashlytics(app?: FirebaseApp): Crashlytics {
171
+ return getOrCreateModularInstance(
172
+ FirebaseCrashlyticsModule,
173
+ config,
174
+ app,
175
+ ) as unknown as Crashlytics;
176
+ }
177
+
178
+ export function checkForUnsentReports(crashlytics: Crashlytics): Promise<boolean> {
179
+ return (crashlytics as CrashlyticsInternal).checkForUnsentReports();
180
+ }
181
+
182
+ export function deleteUnsentReports(crashlytics: Crashlytics): Promise<void> {
183
+ return (crashlytics as CrashlyticsInternal).deleteUnsentReports();
184
+ }
185
+
186
+ export function didCrashOnPreviousExecution(crashlytics: Crashlytics): Promise<boolean> {
187
+ return (crashlytics as CrashlyticsInternal).didCrashOnPreviousExecution();
188
+ }
189
+
190
+ export function crash(crashlytics: Crashlytics): void {
191
+ return (crashlytics as CrashlyticsInternal).crash();
192
+ }
193
+
194
+ export function log(crashlytics: Crashlytics, message: string): void {
195
+ return (crashlytics as CrashlyticsInternal).log(message);
196
+ }
197
+
198
+ export function recordError(crashlytics: Crashlytics, error: Error, jsErrorName?: string): void {
199
+ return (crashlytics as CrashlyticsInternal).recordError(error, jsErrorName);
200
+ }
201
+
202
+ export function sendUnsentReports(crashlytics: Crashlytics): void {
203
+ return (crashlytics as CrashlyticsInternal).sendUnsentReports();
204
+ }
205
+
206
+ export function setUserId(crashlytics: Crashlytics, userId: string): Promise<null> {
207
+ return (crashlytics as CrashlyticsInternal).setUserId(userId);
208
+ }
209
+
210
+ export function setAttribute(crashlytics: Crashlytics, name: string, value: string): Promise<null> {
211
+ return (crashlytics as CrashlyticsInternal).setAttribute(name, value);
212
+ }
213
+
214
+ export function setAttributes(
215
+ crashlytics: Crashlytics,
216
+ attributes: { [key: string]: string },
217
+ ): Promise<null> {
218
+ return (crashlytics as CrashlyticsInternal).setAttributes(attributes);
219
+ }
220
+
221
+ export function setCrashlyticsCollectionEnabled(
222
+ crashlytics: Crashlytics,
223
+ enabled: boolean,
224
+ ): Promise<null> {
225
+ return (crashlytics as CrashlyticsInternal).setCrashlyticsCollectionEnabled(enabled);
226
+ }
227
+
228
+ export type { Crashlytics } from './types/crashlytics';
@@ -125,35 +125,5 @@ export interface Statics {
125
125
  /**
126
126
  * FirebaseApp type with crashlytics() method.
127
127
  * @deprecated Import FirebaseApp from '@react-native-firebase/app' instead.
128
- * The crashlytics() method is added via module augmentation.
129
128
  */
130
129
  export type FirebaseApp = ReactNativeFirebase.FirebaseApp;
131
-
132
- // ============ Module Augmentation ============
133
-
134
- /* eslint-disable @typescript-eslint/no-namespace */
135
- declare module '@react-native-firebase/app' {
136
- namespace ReactNativeFirebase {
137
- interface Module {
138
- crashlytics: FirebaseModuleWithStaticsAndApp<Crashlytics, Statics>;
139
- }
140
- interface FirebaseApp {
141
- crashlytics(): Crashlytics;
142
- }
143
- }
144
- }
145
- /* eslint-enable @typescript-eslint/no-namespace */
146
- // ============ Backwards Compatibility Namespace - to be removed with namespaced exports ============
147
- type _Statics = Statics;
148
-
149
- /**
150
- * @deprecated Use the exported types directly instead.
151
- * FirebaseCrashlyticsTypes namespace is kept for backwards compatibility.
152
- */
153
- /* eslint-disable @typescript-eslint/no-namespace */
154
- export namespace FirebaseCrashlyticsTypes {
155
- // Short name aliases referencing top-level types
156
- export type Module = Crashlytics;
157
- export type Statics = _Statics;
158
- }
159
- /* eslint-enable @typescript-eslint/no-namespace */
@@ -0,0 +1,59 @@
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
+
18
+ import type { Crashlytics } from './crashlytics';
19
+
20
+ export interface NativeRNFBTurboCrashlytics {
21
+ isCrashlyticsCollectionEnabled: boolean;
22
+ isErrorGenerationOnJSCrashEnabled: boolean;
23
+ isCrashlyticsJavascriptExceptionHandlerChainingEnabled: boolean;
24
+ checkForUnsentReports(): Promise<boolean>;
25
+ crash(): void;
26
+ deleteUnsentReports(): Promise<void>;
27
+ didCrashOnPreviousExecution(): Promise<boolean>;
28
+ log(message: string): void;
29
+ setAttribute(name: string, value: string): Promise<null>;
30
+ setAttributes(object: { [key: string]: string }): Promise<null>;
31
+ setUserId(userId: string): Promise<null>;
32
+ recordError(errorObj: unknown): void;
33
+ sendUnsentReports(): void;
34
+ setCrashlyticsCollectionEnabled(enabled: boolean): Promise<null>;
35
+ logPromise(message: string): Promise<void>;
36
+ recordErrorPromise(errorObj: unknown): Promise<void>;
37
+ crashWithStackPromise(errorObj: unknown): Promise<void>;
38
+ }
39
+
40
+ declare module '@react-native-firebase/app/dist/module/internal/NativeModules' {
41
+ interface ReactNativeFirebaseNativeModules {
42
+ NativeRNFBTurboCrashlytics: NativeRNFBTurboCrashlytics;
43
+ }
44
+ }
45
+
46
+ export interface CrashlyticsInternal extends Crashlytics {
47
+ checkForUnsentReports(): Promise<boolean>;
48
+ crash(): void;
49
+ deleteUnsentReports(): Promise<void>;
50
+ didCrashOnPreviousExecution(): Promise<boolean>;
51
+ log(message: string): void;
52
+ recordError(error: Error, jsErrorName?: string): void;
53
+ sendUnsentReports(): void;
54
+ setUserId(userId: string): Promise<null>;
55
+ setAttribute(name: string, value: string): Promise<null>;
56
+ setAttributes(attributes: { [key: string]: string }): Promise<null>;
57
+ setCrashlyticsCollectionEnabled(enabled: boolean): Promise<null>;
58
+ readonly native: NativeRNFBTurboCrashlytics;
59
+ }
package/lib/version.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  // Generated by genversion.
2
- export const version = '25.1.0';
2
+ export const version = '26.1.0';
package/package.json CHANGED
@@ -1,17 +1,34 @@
1
1
  {
2
2
  "name": "@react-native-firebase/crashlytics",
3
- "version": "25.1.0",
3
+ "version": "26.1.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",
7
7
  "types": "./dist/typescript/lib/index.d.ts",
8
+ "codegenConfig": {
9
+ "name": "RNFBCrashlyticsTurboModules",
10
+ "type": "modules",
11
+ "jsSrcsDir": "specs",
12
+ "includesGeneratedCode": true,
13
+ "android": {
14
+ "javaPackageName": "io.invertase.firebase.crashlytics"
15
+ },
16
+ "ios": {
17
+ "modulesProvider": {
18
+ "NativeRNFBTurboCrashlytics": "RNFBCrashlyticsModule"
19
+ }
20
+ }
21
+ },
8
22
  "scripts": {
9
23
  "build": "genversion --esm --semi lib/version.ts",
10
24
  "build:clean": "rimraf android/build && rimraf ios/build",
11
25
  "build:plugin": "rimraf plugin/build && tsc --build plugin",
12
26
  "lint:plugin": "eslint plugin/src/*",
13
27
  "compile": "bob build",
14
- "prepare": "yarn run build && yarn run build:plugin && yarn compile"
28
+ "prepare": "yarn run build && yarn run build:plugin && yarn compile",
29
+ "codegen": "yarn android:codegen && yarn ios:codegen",
30
+ "android:codegen": "npx @react-native-community/cli codegen --platform android --outputPath=./android/src/main/java/io/invertase/firebase/crashlytics/generated",
31
+ "ios:codegen": "npx @react-native-community/cli codegen --platform ios --outputPath=./ios/generated"
15
32
  },
16
33
  "repository": {
17
34
  "type": "git",
@@ -30,13 +47,14 @@
30
47
  "crashlytics"
31
48
  ],
32
49
  "peerDependencies": {
33
- "@react-native-firebase/app": "25.1.0",
50
+ "@react-native-firebase/app": "26.1.0",
34
51
  "expo": ">=47.0.0"
35
52
  },
36
53
  "dependencies": {
37
54
  "stacktrace-js": "^2.0.2"
38
55
  },
39
56
  "devDependencies": {
57
+ "@react-native-firebase/app": "26.1.0",
40
58
  "expo": "^55.0.18",
41
59
  "react-native-builder-bob": "^0.41.0",
42
60
  "typescript": "^6.0.3"
@@ -56,7 +74,14 @@
56
74
  "types": "./dist/typescript/lib/index.d.ts",
57
75
  "default": "./dist/module/index.js"
58
76
  },
59
- "./app.plugin.js": "./app.plugin.js",
77
+ "./app.plugin": {
78
+ "types": "./plugin/build/app.plugin.d.ts",
79
+ "default": "./app.plugin.js"
80
+ },
81
+ "./app.plugin.js": {
82
+ "types": "./plugin/build/app.plugin.d.ts",
83
+ "default": "./app.plugin.js"
84
+ },
60
85
  "./package.json": "./package.json"
61
86
  },
62
87
  "react-native-builder-bob": {
@@ -77,5 +102,5 @@
77
102
  ]
78
103
  ]
79
104
  },
80
- "gitHead": "e0a565d8a73a9b103d140ffacfb8876b30d8bdc5"
105
+ "gitHead": "59d053eca14ab8aa80e5ac76887014925c67e52b"
81
106
  }
@@ -0,0 +1,2 @@
1
+ import plugin from './index';
2
+ export = plugin;
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ const index_1 = __importDefault(require("./index"));
6
+ module.exports = index_1.default;
@@ -0,0 +1,3 @@
1
+ import plugin from './index';
2
+
3
+ export = plugin;
@@ -1 +1 @@
1
- {"root":["./src/index.ts","./src/android/applyPlugin.ts","./src/android/buildscriptDependency.ts","./src/android/constants.ts","./src/android/index.ts"],"version":"6.0.3"}
1
+ {"root":["./src/app.plugin.ts","./src/index.ts","./src/android/applyPlugin.ts","./src/android/buildscriptDependency.ts","./src/android/constants.ts","./src/android/index.ts"],"version":"6.0.3"}
@@ -1,34 +1,9 @@
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
1
  module.exports = {
18
2
  dependency: {
19
3
  platforms: {
20
- ios: {
21
- scriptPhases: [
22
- {
23
- name: '[RNFB] Crashlytics Configuration',
24
- path: './ios_config.sh',
25
- execution_position: 'after_compile',
26
- input_files: [
27
- '${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}/Contents/Resources/DWARF/${TARGET_NAME}',
28
- '$(BUILT_PRODUCTS_DIR)/$(INFOPLIST_PATH)',
29
- ],
30
- },
31
- ],
4
+ android: {
5
+ cmakeListsPath:
6
+ './src/main/java/io/invertase/firebase/crashlytics/generated/jni/CMakeLists.txt',
32
7
  },
33
8
  },
34
9
  },
@@ -0,0 +1,41 @@
1
+ import type { TurboModule } from 'react-native';
2
+ import { TurboModuleRegistry } from 'react-native';
3
+
4
+ export interface CrashlyticsStackFrame {
5
+ src: string;
6
+ line: number;
7
+ col: number;
8
+ fn: string;
9
+ file: string;
10
+ }
11
+
12
+ export interface JavaScriptErrorObject {
13
+ message: string;
14
+ isUnhandledRejection: boolean;
15
+ frames: ReadonlyArray<CrashlyticsStackFrame>;
16
+ }
17
+
18
+ export interface Spec extends TurboModule {
19
+ getConstants(): {
20
+ isCrashlyticsCollectionEnabled: boolean;
21
+ isErrorGenerationOnJSCrashEnabled: boolean;
22
+ isCrashlyticsJavascriptExceptionHandlerChainingEnabled: boolean;
23
+ };
24
+
25
+ checkForUnsentReports(): Promise<boolean>;
26
+ crash(): void;
27
+ crashWithStackPromise(jsErrorDict: JavaScriptErrorObject): Promise<void>;
28
+ deleteUnsentReports(): Promise<void>;
29
+ didCrashOnPreviousExecution(): Promise<boolean>;
30
+ log(message: string): void;
31
+ logPromise(message: string): Promise<void>;
32
+ sendUnsentReports(): void;
33
+ setAttribute(key: string, value: string): Promise<void>;
34
+ setAttributes(attributes: { [key: string]: string }): Promise<void>;
35
+ setUserId(userId: string): Promise<void>;
36
+ recordError(jsErrorDict: JavaScriptErrorObject): void;
37
+ recordErrorPromise(jsErrorDict: JavaScriptErrorObject): Promise<void>;
38
+ setCrashlyticsCollectionEnabled(enabled: boolean): Promise<void>;
39
+ }
40
+
41
+ export default TurboModuleRegistry.getEnforcing<Spec>('NativeRNFBTurboCrashlytics');
package/typedoc.json CHANGED
@@ -1,6 +1,5 @@
1
1
  {
2
2
  "$schema": "https://typedoc.org/schema.json",
3
- "entryPoints": ["lib/modular.ts", "lib/types/crashlytics.ts"],
4
- "tsconfig": "tsconfig.json",
5
- "intentionallyNotExported": ["_Statics"]
3
+ "entryPoints": ["lib/index.ts", "lib/types/crashlytics.ts"],
4
+ "tsconfig": "tsconfig.json"
6
5
  }