From e9c98b410e80e60ecbe8616210664af1a744fbf4 Mon Sep 17 00:00:00 2001 From: Jumpei Matsuda Date: Tue, 13 Aug 2024 15:28:27 +0900 Subject: [PATCH 1/2] Update README.md --- README.md | 49 ++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 46 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index d2f4467..2f5fb12 100644 --- a/README.md +++ b/README.md @@ -49,10 +49,16 @@ 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(). + setEnabledOnNonDebuggableBuild(true). // Make sure you set true here. + build(); +DeployGate.install(context, config); ``` - ## Usage You can retrieve detailed information on current running build and status change events through functions and callback listeners. @@ -84,6 +90,43 @@ DeployGate.registerCallback(new DeployGateCallback() { See [SDK Sample](./sample) for more examples. +### 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(). + 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. @@ -161,4 +204,4 @@ Use GitHub Actions. - [release a new version](.github/workflows/release.yml) - [distribute a new sample with the latest version](.github/workflows/test.yml) -- [deploy the Javadocs](.github/workflows/deploy-javadoc.yml) \ No newline at end of file +- [deploy the Javadocs](.github/workflows/deploy-javadoc.yml) From b252065c9ac3bd342e3279467dd411353425c004 Mon Sep 17 00:00:00 2001 From: Jumpei Matsuda Date: Thu, 15 Aug 2024 11:29:56 +0900 Subject: [PATCH 2/2] Apply suggestions from code review Co-authored-by: satsukies --- README.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 53527f2..54631f4 100644 --- a/README.md +++ b/README.md @@ -53,9 +53,9 @@ import com.deploygate.sdk.DeployGate; import com.deploygate.sdk.DeployGateSdkConfiguration; DeployGateSdkConfiguration config = - new DeployGateSdkConfiguration(). - setEnabledOnNonDebuggableBuild(true). // Make sure you set true here. - build(); + new DeployGateSdkConfiguration.Builder(). + setEnabledOnNonDebuggableBuild(true). // Make sure you set true here. + build(); DeployGate.install(context, config); ``` @@ -98,10 +98,10 @@ Workspaces, which have activated the Capture feature, can storee screenshots, de import com.deploygate.sdk.DeployGate; import com.deploygate.sdk.DeployGateSdkConfiguration; -DeployGateSdkConfiguration config = - new DeployGateSdkConfiguration(). - setCaptureEnabled(true). // Defaults to true - build(); +DeployGateSdkConfiguration config = + new DeployGateSdkConfiguration.Builder() + .setCaptureEnabled(true) // Defaults to true + .build(); DeployGate.install(context, config); ```