Activity history

Shake diligently tracks user's interaction with your app, their network traffic, notifications, logs and system events, and automatically attaches all of those to every bug report.

Introduction

You can inspect all events that lead to a bug being reported. A link to Activity history is located in the top right corner:

Activity screen

Setting up

User actions

SDK automatically observes taps made on your app's UI elements.

On Android, code snippet required to enable touch tracking is added by running add command.

Network requests

Network tracker is disabled by default, to enable network requests tracking use the following method:

App.js
Shake.setNetworkRequestsEnabled(true);

You can add your own custom network requests at any time:

App.js
import Shake, { NetworkRequestBuilder } from '@shakebugs/react-native-shake';
const networkRequestBuilder = new NetworkRequestBuilder()
.setMethod('POST')
.setStatusCode('200')
.setUrl('https://api.example.com')
.setRequestBody('Request body')
.setResponseBody('Response body')
.setRequestHeaders({header1: 'requestHeader'})
.setResponseHeaders({header2: 'responseHeader'})
.setDuration(100)
.setDate(new Date());
Shake.insertNetworkRequest(networkRequestBuilder);

System events

System events are tracked automatically and require no additional setup. These are application lifecycle events.

Notifications

On iOS, notifications are tracked automatically and require no additional setup.

Android requires notifications permission in the settings to track notifications.
Use the following code snippet to show notification settings screen to the user:

App.js
Shake.showNotificationsSettings();

You can add your own custom notification events at any time:

App.js
import Shake, { NotificationEventBuilder } from '@shakebugs/react-native-shake';
const notificationEventBuilder = new NotificationEventBuilder()
.setId('0')
.setTitle('Title')
.setDescription('Description');
Shake.insertNotificationEvent(notificationEventBuilder);

Custom logs

You can add your own custom logs to Activity history, which will then be shown as part of every bug report. Here’s an example of how this would look like in code:

App.js
import Shake, { LogLevel } from '@shakebugs/react-native-shake';
const sendCustomLog = () => {
Shake.log(LogLevel.INFO, 'This is a Shake custom log.');
}

Here are all possible log levels you can use:

LogLevel.VERBOSE
LogLevel.DEBUG
LogLevel.INFO
LogLevel.WARN
LogLevel.ERROR

Console logs

Console logs are recorded automatically and require no additional setup. If you want to disable this feature use the method below:

App.js
Shake.setConsoleLogsEnabled(false);
note

Make sure that activity history is enabled if you want to send console logs with your report.

Limitations

In a Free workspace you can see up to 20 events that lead to every bug. If you need to dive really deep to find causes of the weirdest bugs, in a Premium workspace you can browse the entire activity history.

Enabling and disabling

Activity history is enabled by default, however, you can use the method below to disable it:

App.js
Shake.setEnableActivityHistory(false);