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

Commit

Permalink
fix: Add new Android only config option generateAnonymousKeysAndroid. (
Browse files Browse the repository at this point in the history
  • Loading branch information
yusinto authored Mar 7, 2024
1 parent 94ebdaa commit 5c05b2e
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,12 @@ private LDConfig.Builder buildConfiguration(ReadableMap config) {
}

LDConfig.Builder builder = new LDConfig.Builder(autoEnvAttributes);
builder.generateAnonymousKeys(true);

if (validateConfig("generateAnonymousKeysAndroid", config, ReadableType.Boolean)) {
builder.generateAnonymousKeys(config.getBoolean("generateAnonymousKeysAndroid"));
} else {
builder.generateAnonymousKeys(true);
}

// configure trivial options
for (ConfigMapping entry : ConfigMapping.values()) {
Expand Down
10 changes: 10 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,16 @@ declare module 'launchdarkly-react-native-client-sdk' {
* You can also specify this on a per-context basis with {@link LDContextMeta.privateAttributes}
*/
privateAttributes?: string[];

/**
* Android only.
*
* Set to true to make the SDK provide unique keys for anonymous contexts.
* Read more at https://launchdarkly.github.io/android-client-sdk/com/launchdarkly/sdk/android/LDConfig.Builder.html#generateAnonymousKeys(boolean).
*
* The default is true.
*/
generateAnonymousKeysAndroid?: boolean;
};

/**
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3887,10 +3887,10 @@ react-is@^17.0.1:
resolved "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz"
integrity sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==

"react-native@*", "react-native@^0.73.2":
"integrity" "sha512-7zj9tcUYpJUBdOdXY6cM8RcXYWkyql4kMyGZflW99E5EuFPoC7Ti+ZQSl7LP9ZPzGD0vMfslwyDW0I4tPWUCFw=="
"resolved" "https://registry.npmjs.org/react-native/-/react-native-0.73.2.tgz"
"version" "0.73.2"
react-native@^0.73.2:
version "0.73.2"
resolved "https://registry.npmjs.org/react-native/-/react-native-0.73.2.tgz"
integrity sha512-7zj9tcUYpJUBdOdXY6cM8RcXYWkyql4kMyGZflW99E5EuFPoC7Ti+ZQSl7LP9ZPzGD0vMfslwyDW0I4tPWUCFw==
dependencies:
"@jest/create-cache-key-function" "^29.6.3"
"@react-native-community/cli" "12.3.0"
Expand Down

0 comments on commit 5c05b2e

Please sign in to comment.