Skip to content

Commit 97b3661

Browse files
committed
trackScreenChanges: leave BugSnag breadcrumb on navigation
This commit causes trackScreenChanges to send a breadcrumb of type `navigation` (the only reserved key in this object) and then send the previous screen as well. [GitHub] This commit resolves #1800.
1 parent 23e08a6 commit 97b3661

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

source/app.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import OneSignal from 'react-native-onesignal'
1111
import React from 'react'
1212
import {Provider} from 'react-redux'
1313
import {store} from './flux'
14+
import bugsnag from './bugsnag'
1415
import {tracker} from './analytics'
1516
import {AppNavigator} from './navigation'
1617
import type {NavigationState} from 'react-navigation'
@@ -72,6 +73,11 @@ export default class App extends React.Component {
7273
if (currentScreen !== prevScreen) {
7374
tracker.trackScreenView(currentScreen)
7475
}
76+
77+
bugsnag.leaveBreadcrumb(`Navigated from to ${currentScreen}.`, {
78+
type: 'navigation',
79+
previousScreen: prevousScreen,
80+
})
7581
}
7682

7783
render() {

0 commit comments

Comments
 (0)