Skip to content

Commit 5e3e5a9

Browse files
niallzatoNiall Brennanwenxi-zeng
authored
Add docs for API version below 24 (#84)
* Add docs for API version below 24 * Add docs for API version below 24 * Update JAVA_COMPAT.md Co-authored-by: Wenxi Zeng <[email protected]> Co-authored-by: Niall Brennan <[email protected]> Co-authored-by: Wenxi Zeng <[email protected]>
1 parent 1510073 commit 5e3e5a9

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

JAVA_COMPAT.md

+9
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,15 @@ class YourJsonSerializable implements JsonSerializable {
159159
analytics.track("View Product", new YourJsonSerializable());
160160
```
161161

162+
For implementations supporting a minimum API version below 24, the `buildJsonObjectFunc` function will need to be used.
163+
```java
164+
analytics.track("View Product", Builders.buildJsonObjectFunc(o -> {
165+
o.put("productId", 123)
166+
.put("productName", "Striped trousers");
167+
return Unit.INSTANCE;
168+
}));
169+
```
170+
162171
### identify
163172
The identify call lets you tie a user to their actions and record traits about them. This includes a unique user ID and any optional traits you know about them like their email, name, etc. The traits option can include any information you might want to tie to the user, but when using any of the reserved user traits, you should make sure to only use them for their intended meaning.
164173

0 commit comments

Comments
 (0)