Skip to content
This repository was archived by the owner on Oct 29, 2024. It is now read-only.

Commit 9bcf9ab

Browse files
prepare 8.1.0 release (#251)
## [8.1.0] - 2024-03-07 ### Added: - Added Android only config option generateAnonymousKeysAndroid. This directly maps to the Android SDK config option [generateAnonymousKeys](https://launchdarkly.github.io/android-client-sdk/com/launchdarkly/sdk/android/LDConfig.Builder.html#generateAnonymousKeys(boolean)). Co-authored-by: Yusinto Ngadiman <[email protected]>
1 parent 0449c06 commit 9bcf9ab

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

android/src/main/java/com/launchdarkly/reactnative/LaunchdarklyReactNativeClientModule.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,12 @@ private LDConfig.Builder buildConfiguration(ReadableMap config) {
330330
}
331331

332332
LDConfig.Builder builder = new LDConfig.Builder(autoEnvAttributes);
333-
builder.generateAnonymousKeys(true);
333+
334+
if (validateConfig("generateAnonymousKeysAndroid", config, ReadableType.Boolean)) {
335+
builder.generateAnonymousKeys(config.getBoolean("generateAnonymousKeysAndroid"));
336+
} else {
337+
builder.generateAnonymousKeys(true);
338+
}
334339

335340
// configure trivial options
336341
for (ConfigMapping entry : ConfigMapping.values()) {

index.d.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,16 @@ declare module 'launchdarkly-react-native-client-sdk' {
226226
* You can also specify this on a per-context basis with {@link LDContextMeta.privateAttributes}
227227
*/
228228
privateAttributes?: string[];
229+
230+
/**
231+
* Android only.
232+
*
233+
* Set to true to make the SDK provide unique keys for anonymous contexts.
234+
* Read more at https://launchdarkly.github.io/android-client-sdk/com/launchdarkly/sdk/android/LDConfig.Builder.html#generateAnonymousKeys(boolean).
235+
*
236+
* The default is true.
237+
*/
238+
generateAnonymousKeysAndroid?: boolean;
229239
};
230240

231241
/**

0 commit comments

Comments
 (0)