Skip to main content

Activity history

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

Setup

User actions

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

note

This feature is disabled for apps built with Jetpack Compose.

Network traffic

If you want to receive users' network traffic logs, add this line to your OkHttpClient:

App.kt
val okHttpClient = OkHttpClient()
.newBuilder()
.addInterceptor(ShakeNetworkInterceptor())
.build()

If you don’t use OkHttpClient, use this method to forward requests to Shake:

App.kt
Shake.handleNetworkRequest(
connection: HttpURLConnection,
requestBody: String,
responseBody: String)

You can log your own custom network requests too:

App.kt
val networkRequestBuilder = NetworkRequestBuilder()
.setUrl("https://api.github.com")
.setMethod("POST")
.setRequestHeaders(requestHeaders)
.setRequestBody(requestBody)
.setTimestamp(Date())
Shake.insertNetworkRequest(networkRequestBuilder)

System events

System events - also known as app lifecycle events - are tracked automatically and require no additional setup.

Notifications

In order for Shake to track notifications throughout your app, add this line where appropriate:

App.kt
startActivity(Intent("android.settings." +
"ACTION_NOTIFICATION_LISTENER_SETTINGS"))
note

This starts the notification listener service, which will require users to grant notification access the first time they open your app.

If you want Shake to manually handle notification tracking, use this method instead:

App.kt
Shake.handleNotification(
notificationTitle: String,
notificationDescription: String
)

Custom logs

You can add your own logs to Activity history too:

App.kt
Shake.log(LogLevel.INFO, "Log message goes here!")

You have these log levels at your disposal:

App.kt
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.kt
Shake.getReportConfiguration().isConsoleLogsEnabled = false

Limitations

In a Free workspace you can see up to 20 events that led to the ticket being reported. If you need to dive really deep to find causes of the weirdest bugs, in a Premium workspace you can browse the full Activity history.

The network request limits for both the request body and the response body are 100 kB each. If the request body or the response body contains binary data, it will be presented as a Binary data string.

Disable

Activity history is enabled by default, use the method below to disable it altogether:

App.kt
Shake.getReportConfiguration().isEnableActivityHistory = false