Navigator traces

Bugsee will automatically handle top view changes for NavigatorIOS and register viewWillAppear, viewDidAppear and viewDidDisappear system events.

For the standard Navigator, if you want to track your views/routes there is additional work that has to be performed.

When creating a navigator, register Bugsee.onDidFocus as a listener:

  // ... skipped ...
  render() {
    return (
      <Navigator
        style={{ flex:1 }}
        initialRoute={{ title: 'Main', component: SearchPage }}
        renderScene={ this.renderScene } 
        onDidFocus={ Bugsee.onDidFocus } // <------ added this line
      />
      );
  }

the code above with register onDidFocus events in the reports, as well as track the title of the current route in the traces.

In case you use the onDidFocus hook yourself, just wrap it with your own method:

  // ... skipped ...
  render() {
    return (
      <Navigator
        style={{ flex:1 }}
        initialRoute={{ title: 'Main', component: SearchPage }}
        renderScene={ this.renderScene } 
        onDidFocus={ this.onDidFocus } // <------ this line
      />
      );
  }

  onDidFocus(route) {

    // Do my stuff here...

    Bugsee.onDidFocus(route)
  }