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

Commit

Permalink
Merge pull request #22 from distinctdan/master
Browse files Browse the repository at this point in the history
Added more docs for passing a stacktrace to logError
  • Loading branch information
sagrawal31 authored Jun 25, 2019
2 parents 999f666 + 263507e commit 0d798b5
Showing 1 changed file with 10 additions and 7 deletions.
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");
```
```

0 comments on commit 0d798b5

Please sign in to comment.