Skip to content
This repository has been archived by the owner on Jul 27, 2019. It is now read-only.

Added more docs for passing a stacktrace to logError #22

Merged
merged 2 commits into from
Jun 25, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Added more docs for passing a stacktrace to logError
  • Loading branch information
distinctdan authored Jun 24, 2019
commit 263507ee3ac3e503f9cff7ba891aae0f05da8f12
17 changes: 10 additions & 7 deletions docs/API.md
Original file line number Diff line number Diff line change
Expand Up @@ -219,14 +219,17 @@ window.FirebasePlugin.logError("Any JS error message", function () {
});
```

Optionally, you can pass a JavaScript error stacktrace which will be parsed and included in the Crashlytics web console.
Optionally, you can pass a JavaScript error stacktrace from [StackTrace.js](https://www.stacktracejs.com/) which will be parsed and included in the Crashlytics web console. Unfortunately, on iOS, setting custom stack traces isn't natively supported, so the stack lines are logged as key/value pairs instead, which show up in the `Keys` section of an error in the firebase console.

```javascript
window.FirebasePlugin.logError("Any JS error message", ["stacktrace"], function () {
// Optional function for success callback
}, function () {
// Optional function for error callback
});
StackTrace.fromError(error, {offline: true})
.then(function(stack) {
window.FirebasePlugin.logError("Any JS error message", stack, function () {
// Optional function for success callback
}, function () {
// Optional function for error callback
});
}
```

## Firebase Auth
Expand Down Expand Up @@ -432,4 +435,4 @@ Stop the trace

```javascript
window.FirebasePlugin.stopTrace("test trace");
```
```