Skip to content

Commit 02a994f

Browse files
authored
chore: add android polling docs (#588)
1 parent 1e9edde commit 02a994f

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

docs/sdks/client-sdks/android/initialization.mdx

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,48 @@ CompletableFuture<EppoClient> eppoClientFuture = new EppoClient.Builder("YOUR_SD
112112

113113
The initialization methods, `buildAndInit` and `buildAndInitAsync` return or resolve to an `EppoClient` instance with a loaded configuration.
114114

115+
### Mobile Polling
116+
117+
The SDK can be configured to poll the Eppo API periodically to get the latest configuration.
118+
119+
<ApiOptionRef
120+
name="pollingIntervalMs"
121+
type="long"
122+
defaultValue="null"
123+
>
124+
125+
Maximum amount of time to wait between calls to the API for the latest configuration.
126+
</ApiOptionRef>
127+
128+
<ApiOptionRef
129+
name="pollingJitterMs"
130+
type="long"
131+
defaultValue="-1"
132+
>
133+
134+
Limit to the amount of randomized difference in length of each polling interval. A value `-1` triggers the default, which is 10% of the `pollingIntervalMs`.
135+
</ApiOptionRef>
136+
137+
138+
When enabling polling, it is important to tie into the application's lifecycle to pause and resume pollings
139+
140+
```java
141+
// Tie into the activity's lifecycle and pause/resume polling where appropriate.
142+
143+
@Override
144+
public void onPause() {
145+
super.onPause();
146+
EppoClient.getInstance().pausePolling();
147+
}
148+
149+
@Override
150+
public void onResume() {
151+
super.onResume();
152+
EppoClient.getInstance().resumePolling();
153+
}
154+
155+
```
156+
115157
### Assignment Logger Schema
116158

117159
The SDK will invoke the `logAssignment` function with an `Assignment` object that contains the following fields:

0 commit comments

Comments
 (0)