Skip to content

Commit

Permalink
Merge pull request #94 from DeployGate/jmatsu-patch-2
Browse files Browse the repository at this point in the history
Add Capture feature to README
  • Loading branch information
jmatsu authored Aug 15, 2024
2 parents 4f825b8 + b252065 commit 0af625d
Showing 1 changed file with 45 additions and 1 deletion.
46 changes: 45 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,14 @@ And also, you need to call `DeployGate#install` in your Application class, Conte
For example, add to your custom application class, content provider, or else.

```java
DeployGate.install(context, /** forceApplyOnReleaseBuild */ false);
import com.deploygate.sdk.DeployGate;
import com.deploygate.sdk.DeployGateSdkConfiguration;

DeployGateSdkConfiguration config =
new DeployGateSdkConfiguration.Builder().
setEnabledOnNonDebuggableBuild(true). // Make sure you set true here.
build();
DeployGate.install(context, config);
```

## Usage
Expand Down Expand Up @@ -83,6 +90,43 @@ DeployGate.registerCallback(new DeployGateCallback() {

For the more details, pelase refer to [DeployGate Docs - Android SDK](https://docs.deploygate.com/docs/developer-tools/android-sdk/)

### Capture feature

Workspaces, which have activated the Capture feature, can storee screenshots, device states and Logcat at DeployGate. The Capture feature is enabled by default.

```java
import com.deploygate.sdk.DeployGate;
import com.deploygate.sdk.DeployGateSdkConfiguration;

DeployGateSdkConfiguration config =
new DeployGateSdkConfiguration.Builder()
.setCaptureEnabled(true) // Defaults to true
.build();
DeployGate.install(context, config);
```

Please refer to https://docs.deploygate.com/docs/developer-guide/capture/about-capture for the details.

#### Custom Attributes

You can add attributes to Captures.

```java
import com.deploygate.sdk.DeployGate;

CustomAttributes buildEnvironment = DeployGate.getBuildEnvironment();
buildEnvironment.putString("git_ref", BuildConfig.BUILD_GIT_REF);

CustomAttributes runtimeExtra = DeployGate.getRuntimeExtra();
runtimeExtra.putString("is_authorized", authorizationRepository.isAuthorized());
```

**Limitation**

- `buildEnvironment` and `runtimeExtra` allow only at most **8** attributes.
- Attribute keys must consist of `_a-z0-9` and must start with `a-z`.
- Every value must be equal or shorter than 64 length.

## Mock

Do you want to disable DeployGate SDK on production builds? If so, please use `sdk-mock` dependency for production builds instead of `sdk`. `sdk-mock` dependency has public interfaces that are same as of `sdk` but their implementations are empty, so you don't have to modify your app code for specific build variants.
Expand Down

0 comments on commit 0af625d

Please sign in to comment.