@react-native-firebase/crashlytics 18.3.1 → 18.4.0

Sign up to get free protection for your applications and to get access to all the features.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,18 @@
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
+
12
+ ## [18.3.2](https://github.com/invertase/react-native-firebase/compare/v18.3.1...v18.3.2) (2023-09-02)
13
+
14
+ ### Bug Fixes
15
+
16
+ - **app, sdks:** adopt firebase-android-sdk 32.2.3 ([129d6ef](https://github.com/invertase/react-native-firebase/commit/129d6ef1eb1b45be3390687a002bddfe87386fa3))
17
+
6
18
  ## [18.3.1](https://github.com/invertase/react-native-firebase/compare/v18.3.0...v18.3.1) (2023-08-23)
7
19
 
8
20
  ### Bug Fixes
@@ -11,7 +11,7 @@ buildscript {
11
11
  }
12
12
 
13
13
  dependencies {
14
- classpath("com.android.tools.build:gradle:7.0.4")
14
+ classpath("com.android.tools.build:gradle:8.1.1")
15
15
  }
16
16
  }
17
17
  }
@@ -60,16 +60,29 @@ project.ext {
60
60
  }
61
61
 
62
62
  android {
63
+ def agpVersion = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION.tokenize('.')[0].toInteger()
64
+ if (agpVersion >= 7) {
65
+ namespace 'io.invertase.firebase.crashlytics'
66
+ }
67
+
63
68
  defaultConfig {
64
69
  multiDexEnabled true
65
70
  }
71
+
72
+ buildFeatures {
73
+ // AGP 8 no longer builds config by default
74
+ buildConfig true
75
+ }
76
+
66
77
  lintOptions {
67
78
  disable 'GradleCompatible'
68
79
  abortOnError false
69
80
  }
70
- compileOptions {
71
- sourceCompatibility JavaVersion.VERSION_1_8
72
- targetCompatibility JavaVersion.VERSION_1_8
81
+ if (agpVersion < 8) {
82
+ compileOptions {
83
+ sourceCompatibility JavaVersion.VERSION_11
84
+ targetCompatibility JavaVersion.VERSION_11
85
+ }
73
86
  }
74
87
  }
75
88
 
package/lib/index.d.ts CHANGED
@@ -77,7 +77,7 @@ export namespace FirebaseCrashlyticsTypes {
77
77
  * ```
78
78
  *
79
79
  */
80
- isCrashlyticsCollectionEnabled: true;
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
@@ -139,6 +139,8 @@ class FirebaseCrashlyticsModule extends FirebaseModule {
139
139
  }
140
140
  }
141
141
 
142
+ export * from './modular';
143
+
142
144
  // import { SDK_VERSION } from '@react-native-firebase/crashlytics';
143
145
  export const SDK_VERSION = version;
144
146
 
@@ -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.3.1';
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.1",
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.3.1",
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": "878f4199ca99963dec7822d1c9e14e9c91325b4f"
49
+ "gitHead": "5f6460a87970d8b6013530de980bc760ddc70f90"
50
50
  }