@react-native-firebase/crashlytics 18.3.2 → 18.4.0
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +6 -0
- package/lib/index.d.ts +1 -1
- package/lib/index.js +2 -0
- package/lib/modular/index.d.ts +207 -0
- package/lib/modular/index.js +118 -0
- package/lib/version.js +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
@@ -3,6 +3,12 @@
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
5
5
|
|
6
|
+
## [18.4.0](https://github.com/invertase/react-native-firebase/compare/v18.3.2...v18.4.0) (2023-09-11)
|
7
|
+
|
8
|
+
### Features
|
9
|
+
|
10
|
+
- **crashlytics:** Firbase web modular V9 API ([#7283](https://github.com/invertase/react-native-firebase/issues/7283)) ([57f7327](https://github.com/invertase/react-native-firebase/commit/57f7327da4b405dace6b040e8a942d5f107f3603))
|
11
|
+
|
6
12
|
## [18.3.2](https://github.com/invertase/react-native-firebase/compare/v18.3.1...v18.3.2) (2023-09-02)
|
7
13
|
|
8
14
|
### Bug Fixes
|
package/lib/index.d.ts
CHANGED
@@ -77,7 +77,7 @@ export namespace FirebaseCrashlyticsTypes {
|
|
77
77
|
* ```
|
78
78
|
*
|
79
79
|
*/
|
80
|
-
isCrashlyticsCollectionEnabled:
|
80
|
+
isCrashlyticsCollectionEnabled: boolean;
|
81
81
|
/**
|
82
82
|
* Determines whether there are any unsent crash reports cached on the device. The callback only executes
|
83
83
|
* if automatic data collection is disabled.
|
package/lib/index.js
CHANGED
@@ -0,0 +1,207 @@
|
|
1
|
+
import { FirebaseCrashlyticsTypes } from '..';
|
2
|
+
|
3
|
+
type FirebaseCrashlytics = FirebaseCrashlyticsTypes.Module;
|
4
|
+
|
5
|
+
/**
|
6
|
+
* Returns Crashlytics instance.
|
7
|
+
* #### Example
|
8
|
+
* ```js
|
9
|
+
* const crashlytics = getCrashlytics();
|
10
|
+
* ```
|
11
|
+
*/
|
12
|
+
export declare function getCrashlytics(): FirebaseCrashlytics;
|
13
|
+
|
14
|
+
/**
|
15
|
+
* Whether Crashlytics reporting is enabled.
|
16
|
+
*
|
17
|
+
* #### Example
|
18
|
+
*
|
19
|
+
* ```js
|
20
|
+
* const crashlytics = getCrashlytics();
|
21
|
+
* const isEnabled = isCrashlyticsCollectionEnabled(crashlytics);
|
22
|
+
* ```
|
23
|
+
*/
|
24
|
+
export declare function isCrashlyticsCollectionEnabled(crashlytics: FirebaseCrashlytics): boolean;
|
25
|
+
/**
|
26
|
+
* Determines whether there are any unsent crash reports cached on the device. The callback only executes
|
27
|
+
* if automatic data collection is disabled.
|
28
|
+
*
|
29
|
+
* #### Example
|
30
|
+
*
|
31
|
+
* ```js
|
32
|
+
* async checkReports() {
|
33
|
+
* // returns boolean value
|
34
|
+
* const crashlytics = getCrashlytics();
|
35
|
+
* const unsentReports = await checkForUnsentReports(crashlytics);
|
36
|
+
* }
|
37
|
+
*
|
38
|
+
* checkReports();
|
39
|
+
* ```
|
40
|
+
*/
|
41
|
+
export declare function checkForUnsentReports(crashlytics: FirebaseCrashlytics): Promise<boolean>;
|
42
|
+
/**
|
43
|
+
* Deletes any unsent reports on the device. This method only applies if automatic data collection is
|
44
|
+
* disabled.
|
45
|
+
*
|
46
|
+
* #### Example
|
47
|
+
*
|
48
|
+
* ```js
|
49
|
+
* const crashlytics = getCrashlytics();
|
50
|
+
* deleteUnsentReports(crashlytics);
|
51
|
+
* ```
|
52
|
+
*/
|
53
|
+
export declare function deleteUnsentReports(crashlytics: FirebaseCrashlytics): Promise<void>;
|
54
|
+
/**
|
55
|
+
* Returns a boolean value indicating whether the app crashed during the previous execution.
|
56
|
+
*
|
57
|
+
* #### Example
|
58
|
+
*
|
59
|
+
* ```js
|
60
|
+
* async didCrashPreviously() {
|
61
|
+
* // returns boolean value
|
62
|
+
* const crashlytics = getCrashlytics();
|
63
|
+
* const didCrash = await didCrashOnPreviousExecution(crashlytics);
|
64
|
+
* }
|
65
|
+
*
|
66
|
+
* didCrashPreviously();
|
67
|
+
* ```
|
68
|
+
*/
|
69
|
+
export declare function didCrashOnPreviousExecution(
|
70
|
+
crashlytics: FirebaseCrashlytics,
|
71
|
+
): Promise<boolean>;
|
72
|
+
|
73
|
+
/**
|
74
|
+
* Cause your app to crash for testing purposes. This is a native crash and will not contain a javascript stack trace.
|
75
|
+
* Note that crashes are intercepted by debuggers on iOS so no report will be seen under those conditions. Additionally
|
76
|
+
* if it is a debug build you will need to ensure your firebase.json is configured to enable crashlytics even in debug mode.
|
77
|
+
*
|
78
|
+
* #### Example
|
79
|
+
*
|
80
|
+
* ```js
|
81
|
+
* const crashlytics = getCrashlytics();
|
82
|
+
* crash(crashlytics);
|
83
|
+
* ```
|
84
|
+
*/
|
85
|
+
export declare function crash(crashlytics: FirebaseCrashlytics): void;
|
86
|
+
|
87
|
+
/**
|
88
|
+
* Log a message that will appear in any subsequent Crash or Non-fatal error reports.
|
89
|
+
*
|
90
|
+
* #### Example
|
91
|
+
*
|
92
|
+
* ```js
|
93
|
+
* const crashlytics = getCrashlytics();
|
94
|
+
* log(crashlytics, 'Testing a crash');
|
95
|
+
* crash(crashlytics);
|
96
|
+
* ```
|
97
|
+
*/
|
98
|
+
export declare function log(crashlytics: FirebaseCrashlytics, message: string): void;
|
99
|
+
|
100
|
+
/**
|
101
|
+
* Record a JavaScript Error.
|
102
|
+
*
|
103
|
+
* The JavaScript stack trace is converted into a mock native iOS or Android exception before submission.
|
104
|
+
* The line numbers in the stack trace (if available) will be relative to the javascript bundle built by your packager,
|
105
|
+
* after whatever transpilation or minimization steps happen. You will need to maintain sourcemaps to decode them if desired.
|
106
|
+
*
|
107
|
+
* #### Example
|
108
|
+
*
|
109
|
+
* ```js
|
110
|
+
* const crashlytics = getCrashlytics();
|
111
|
+
* recordError(
|
112
|
+
* crashlytics,
|
113
|
+
* new Error('An error was caught')
|
114
|
+
* );
|
115
|
+
* ```
|
116
|
+
*/
|
117
|
+
export declare function recordError(
|
118
|
+
crashlytics: FirebaseCrashlytics,
|
119
|
+
error: Error,
|
120
|
+
jsErrorName?: string,
|
121
|
+
): void;
|
122
|
+
/**
|
123
|
+
* Enqueues any unsent reports on the device to upload to Crashlytics. This method only applies if
|
124
|
+
* automatic data collection is disabled.
|
125
|
+
*
|
126
|
+
* #### Example
|
127
|
+
*
|
128
|
+
* ```js
|
129
|
+
* const crashlytics = getCrashlytics();
|
130
|
+
* sendUnsentReports(crashlytics);
|
131
|
+
* ```
|
132
|
+
*/
|
133
|
+
export declare function sendUnsentReports(crashlytics: FirebaseCrashlytics): void;
|
134
|
+
|
135
|
+
/**
|
136
|
+
* Specify a user identifier which will be visible in the Firebase Crashlytics console.
|
137
|
+
*
|
138
|
+
* It is recommended for privacy purposes that this value be a value that's meaningless to a third-party
|
139
|
+
* observer; such as an arbitrary string that ties an end-user to a record in your system e.g. a database record id.
|
140
|
+
*
|
141
|
+
* #### Example
|
142
|
+
*
|
143
|
+
* ```js
|
144
|
+
* const auth = getAuth();
|
145
|
+
* const crashlytics = getCrashlytics();
|
146
|
+
* // Custom user id
|
147
|
+
* await setUserId(crashlytics, '123456789');
|
148
|
+
* // Firebase auth uid
|
149
|
+
* await setUserId(
|
150
|
+
* crashlytics,
|
151
|
+
* auth.currentUser.uid
|
152
|
+
* );
|
153
|
+
* ```
|
154
|
+
*/
|
155
|
+
export declare function setUserId(crashlytics: FirebaseCrashlytics, userId: string): Promise<null>;
|
156
|
+
|
157
|
+
/**
|
158
|
+
* Sets a string value to be associated with the given attribute name which will be visible in the Firebase Crashlytics console.
|
159
|
+
*
|
160
|
+
* #### Example
|
161
|
+
*
|
162
|
+
* ```js
|
163
|
+
* const crashlytics = getCrashlytics();
|
164
|
+
* await setAttribute(crashlytics, 'role', 'admin');
|
165
|
+
* ```
|
166
|
+
*/
|
167
|
+
export declare function setAttribute(
|
168
|
+
crashlytics: FirebaseCrashlytics,
|
169
|
+
name: string,
|
170
|
+
value: string,
|
171
|
+
): Promise<null>;
|
172
|
+
|
173
|
+
/**
|
174
|
+
* Like `setAttribute` but for multiple attributes.
|
175
|
+
*
|
176
|
+
* #### Example
|
177
|
+
*
|
178
|
+
* ```js
|
179
|
+
* const crashlytics = getCrashlytics();
|
180
|
+
* await setAttributes(crashlytics, {
|
181
|
+
* role: 'admin',
|
182
|
+
* followers: '13',
|
183
|
+
* });
|
184
|
+
* ```
|
185
|
+
*/
|
186
|
+
export declare function setAttributes(
|
187
|
+
crashlytics: FirebaseCrashlytics,
|
188
|
+
attributes: { [key: string]: string },
|
189
|
+
): Promise<null>;
|
190
|
+
|
191
|
+
/**
|
192
|
+
* Enable/disable Crashlytics reporting.
|
193
|
+
*
|
194
|
+
* Use this for opt-in first user data collection flows combined with `firebase.json` settings to disable auto collection.
|
195
|
+
*
|
196
|
+
* #### Example
|
197
|
+
*
|
198
|
+
* ```js
|
199
|
+
* const crashlytics = getCrashlytics();
|
200
|
+
* // Disable crash reporting
|
201
|
+
* await setCrashlyticsCollectionEnabled(crashlytics, false);
|
202
|
+
* ```
|
203
|
+
*/
|
204
|
+
export declare function setCrashlyticsCollectionEnabled(
|
205
|
+
crashlytics: FirebaseCrashlytics,
|
206
|
+
enabled: boolean,
|
207
|
+
): Promise<null>;
|
@@ -0,0 +1,118 @@
|
|
1
|
+
import { firebase } from '..';
|
2
|
+
|
3
|
+
/**
|
4
|
+
* @typedef {import("..").FirebaseApp} FirebaseApp
|
5
|
+
* @typedef {import("..").FirebaseCrashlyticsTypes.Module} FirebaseCrashlytics
|
6
|
+
*/
|
7
|
+
|
8
|
+
/**
|
9
|
+
* @param {FirebaseApp} app
|
10
|
+
* @returns {FirebaseCrashlytics}
|
11
|
+
*/
|
12
|
+
export function getCrashlytics() {
|
13
|
+
return firebase.crashlytics();
|
14
|
+
}
|
15
|
+
|
16
|
+
/**
|
17
|
+
* @param {FirebaseCrashlytics} crashlytics
|
18
|
+
* @returns {boolean}
|
19
|
+
*/
|
20
|
+
export function isCrashlyticsCollectionEnabled(crashlytics) {
|
21
|
+
return crashlytics.isCrashlyticsCollectionEnabled;
|
22
|
+
}
|
23
|
+
|
24
|
+
/**
|
25
|
+
* @param {FirebaseCrashlytics} crashlytics
|
26
|
+
* @returns {Promise<boolean>}
|
27
|
+
*/
|
28
|
+
export function checkForUnsentReports(crashlytics) {
|
29
|
+
return crashlytics.checkForUnsentReports();
|
30
|
+
}
|
31
|
+
|
32
|
+
/**
|
33
|
+
* @param {FirebaseCrashlytics} crashlytics
|
34
|
+
* @returns {Promise<void>}
|
35
|
+
*/
|
36
|
+
export function deleteUnsentReports(crashlytics) {
|
37
|
+
return crashlytics.deleteUnsentReports();
|
38
|
+
}
|
39
|
+
|
40
|
+
/**
|
41
|
+
* @param {FirebaseCrashlytics} crashlytics
|
42
|
+
* @returns {Promise<boolean>}
|
43
|
+
*/
|
44
|
+
export function didCrashOnPreviousExecution(crashlytics) {
|
45
|
+
return crashlytics.didCrashOnPreviousExecution();
|
46
|
+
}
|
47
|
+
|
48
|
+
/**
|
49
|
+
* @param {FirebaseCrashlytics} crashlytics
|
50
|
+
* @returns {void}
|
51
|
+
*/
|
52
|
+
export function crash(crashlytics) {
|
53
|
+
return crashlytics.crash();
|
54
|
+
}
|
55
|
+
|
56
|
+
/**
|
57
|
+
* @param {FirebaseCrashlytics} crashlytics
|
58
|
+
* @param {string} message
|
59
|
+
* @returns {void}
|
60
|
+
*/
|
61
|
+
export function log(crashlytics, message) {
|
62
|
+
return crashlytics.log(message);
|
63
|
+
}
|
64
|
+
|
65
|
+
/**
|
66
|
+
* @param {FirebaseCrashlytics} crashlytics
|
67
|
+
* @param {Error} error
|
68
|
+
* @param {string | undefined} jsErrorName
|
69
|
+
* @returns {void}
|
70
|
+
*/
|
71
|
+
export function recordError(crashlytics, error, jsErrorName) {
|
72
|
+
return crashlytics.recordError(error, jsErrorName);
|
73
|
+
}
|
74
|
+
|
75
|
+
/**
|
76
|
+
* @param {FirebaseCrashlytics} crashlytics
|
77
|
+
* @returns {void}
|
78
|
+
*/
|
79
|
+
export function sendUnsentReports(crashlytics) {
|
80
|
+
return crashlytics.sendUnsentReports();
|
81
|
+
}
|
82
|
+
|
83
|
+
/**
|
84
|
+
* @param {FirebaseCrashlytics} crashlytics
|
85
|
+
* @param {string} userId
|
86
|
+
* @returns {Promise<null>}
|
87
|
+
*/
|
88
|
+
export function setUserId(crashlytics, userId) {
|
89
|
+
return crashlytics.setUserId(userId);
|
90
|
+
}
|
91
|
+
|
92
|
+
/**
|
93
|
+
* @param {FirebaseCrashlytics} crashlytics
|
94
|
+
* @param {string} name
|
95
|
+
* @param {string} value
|
96
|
+
* @returns {Promise<null>}
|
97
|
+
*/
|
98
|
+
export function setAttribute(crashlytics, name, value) {
|
99
|
+
return crashlytics.setAttribute(name, value);
|
100
|
+
}
|
101
|
+
|
102
|
+
/**
|
103
|
+
* @param {FirebaseCrashlytics} crashlytics
|
104
|
+
* @param {{ [key: string]: string }} attributes
|
105
|
+
* @returns {Promise<null>}
|
106
|
+
*/
|
107
|
+
export function setAttributes(crashlytics, attributes) {
|
108
|
+
return crashlytics.setAttributes(attributes);
|
109
|
+
}
|
110
|
+
|
111
|
+
/**
|
112
|
+
* @param {FirebaseCrashlytics} crashlytics
|
113
|
+
* @param {boolean} enabled
|
114
|
+
* @returns {Promise<null>}
|
115
|
+
*/
|
116
|
+
export function setCrashlyticsCollectionEnabled(crashlytics, enabled) {
|
117
|
+
return crashlytics.setCrashlyticsCollectionEnabled(enabled);
|
118
|
+
}
|
package/lib/version.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1
1
|
// Generated by genversion.
|
2
|
-
module.exports = '18.
|
2
|
+
module.exports = '18.4.0';
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@react-native-firebase/crashlytics",
|
3
|
-
"version": "18.
|
3
|
+
"version": "18.4.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": "lib/index.js",
|
@@ -29,7 +29,7 @@
|
|
29
29
|
"crashlytics"
|
30
30
|
],
|
31
31
|
"peerDependencies": {
|
32
|
-
"@react-native-firebase/app": "18.
|
32
|
+
"@react-native-firebase/app": "18.4.0",
|
33
33
|
"expo": ">=47.0.0"
|
34
34
|
},
|
35
35
|
"dependencies": {
|
@@ -46,5 +46,5 @@
|
|
46
46
|
"publishConfig": {
|
47
47
|
"access": "public"
|
48
48
|
},
|
49
|
-
"gitHead": "
|
49
|
+
"gitHead": "5f6460a87970d8b6013530de980bc760ddc70f90"
|
50
50
|
}
|