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
:
- Java
- Kotlin
OkHttpClient okHttpClient = new OkHttpClient().newBuilder().addInterceptor(new ShakeNetworkInterceptor()).build();
val okHttpClient = OkHttpClient().newBuilder().addInterceptor(ShakeNetworkInterceptor()).build()
If you donβt use OkHttpClient, use this method to forward requests to Shake:
- Java
- Kotlin
Shake.handleNetworkRequest(HttpURLConnection connection,String requestBody,String responseBody);
Shake.handleNetworkRequest(connection: HttpURLConnection,requestBody: String,responseBody: String)
You can log your own custom network requests too:
- Java
- Kotlin
NetworkRequestBuilder networkRequestBuilder = new NetworkRequestBuilder().setUrl("https://api.github.com").setMethod("POST").setRequestHeaders(requestHeaders).setRequestBody(requestBody).setTimestamp(new Date());Shake.insertNetworkRequest(networkRequestBuilder);
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.
Screen changes
Screen changes are tracked automatically and require no additional setup.
note
The SDK will collect just changes of Android Activities, adding, removing or replacing Fragments inside an Activity is not tracked.
Notifications
In order for Shake to track notifications throughout your app, add this line where appropriate:
- Java
- Kotlin
startActivity(new Intent("android.settings." +"ACTION_NOTIFICATION_LISTENER_SETTINGS"));
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:
- Java
- Kotlin
Shake.handleNotification(String notificationTitle,String notificationDescription);
Shake.handleNotification(notificationTitle: String,notificationDescription: String)
Custom logs
You can add your own logs to Activity history too:
- Java
- Kotlin
Shake.log(LogLevel.INFO, "Log message goes here!");
Shake.log(LogLevel.INFO, "Log message goes here!")
You have these log levels at your disposal:
- Java
- Kotlin
LogLevel.VERBOSELogLevel.DEBUGLogLevel.INFOLogLevel.WARNLogLevel.ERROR
LogLevel.VERBOSELogLevel.DEBUGLogLevel.INFOLogLevel.WARNLogLevel.ERROR
Console logs
Console logs are recorded automatically and require no additional setup. If you want to disable this feature use the method below:
- Java
- Kotlin
Shake.getReportConfiguration().setConsoleLogsEnabled(false);
Shake.getReportConfiguration().isConsoleLogsEnabled = false
Disable
Activity history is enabled by default, use the method below to disable it altogether:
- Java
- Kotlin
Shake.getReportConfiguration().setEnableActivityHistory(false);
Shake.getReportConfiguration().isEnableActivityHistory = false