You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To test Crashlytics for your app, call the `crash` method to force a crash and in Firebase Console, see if the crash is logged.
100
98
101
99
```ts
102
-
firebase().crashlytics().crash()
100
+
firebase().crashlytics().crash();
103
101
```
104
102
105
-
### Report errors manually
103
+
### Report errors manually
106
104
107
-
Crashlytics also supports sending JavaScript stack traces to the Firebase console. This can be used in any situation where an error occurs but is caught by your code to recover gracefully.
105
+
Crashlytics also supports sending JavaScript stack traces to the Firebase console. This can be used in any situation where an error occurs but is caught by your code to recover gracefully.
108
106
109
107
To send a stack trace, pass a JavaScript Error to the `recordError` method.
110
108
@@ -116,18 +114,18 @@ import { firebase } from '@nativescript/firebase-core';
116
114
firebase().crashlytics().log('Updating user count.');
117
115
118
116
try {
119
-
if (users) {
120
-
someMethodToCatch();
121
-
}
117
+
if (users) {
118
+
someMethodToCatch();
119
+
}
122
120
} catch (error) {
123
-
crashlytics().recordError(error);
124
-
console.log(error);
121
+
crashlytics().recordError(error);
122
+
console.log(error);
125
123
}
126
124
```
127
125
128
-
### Manually enable or disable crashlytics collection
126
+
### Manually enable or disable crashlytics collection
129
127
130
-
As Crashlytics will be sending certain information regarding the user, users may want to opt out of the crash reporting. To disable crashlytics collection, call the `setCrashlyticsCollectionEnabled` method on `firebase().crashlytics()` passing it `false`This can be done throughout the app with a simple method call to setCrashlyticsCollectionEnabled:
128
+
As Crashlytics will be sending certain information regarding the user, users may want to opt out of the crash reporting. To disable crashlytics collection, call the `setCrashlyticsCollectionEnabled` method on `firebase().crashlytics()` passing it `false` This can be done throughout the app with a simple method call to setCrashlyticsCollectionEnabled:
0 commit comments