diff --git a/.circleci/config.yml b/.circleci/config.yml index 721e407..ad5778c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -138,7 +138,7 @@ workflows: name: rn<>-xc<>-build-apps-using-template matrix: parameters: - rn-version: ["0.64.3", "0.65.2", "0.66.4", "0.67.3"] + rn-version: ["0.64.3", "0.65.2", "0.66.4", "0.67.3", "0.68.0"] xcode-version: ["12.2.0", "12.5.1", "13.2.1"] requires: - test-javascript diff --git a/ManualTestApp/App.js b/ManualTestApp/App.js index 20a724f..3c57b18 100644 --- a/ManualTestApp/App.js +++ b/ManualTestApp/App.js @@ -63,9 +63,9 @@ const Body = () => { } else if (flagType === 'string') { res = await client.stringVariation(flagKey, ''); } else if (flagType === 'int') { - res = await client.intVariation(flagKey, 0); + res = await client.numberVariation(flagKey, 0); } else if (flagType === 'float') { - res = await client.floatVariation(flagKey, 0.0); + res = await client.numberVariation(flagKey, 0.0); } else if (flagType === 'array') { res = await client.jsonVariation(flagKey, []); } else if (flagType === 'object') { diff --git a/README.md b/README.md index 66f4be7..092cb63 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ LaunchDarkly overview Supported versions ------------------------- -This SDK is currently compatible with React Native versions `>=0.64 <0.68`, the minimum iOS deployment target is `10.0`, and the minimum Android SDK version is `21`. Builds are tested with XCode 12.2+. +This SDK is currently compatible with React Native versions `>=0.64 <0.69`, the minimum iOS deployment target is `10.0`, and the minimum Android SDK version is `21`. Builds are tested with XCode 12.2+. For React Native `0.63.x` support, use the latest [`5.1.x` release](https://github.com/launchdarkly/react-native-client-sdk/releases/tag/5.1.1). diff --git a/android/src/main/java/com/launchdarkly/reactnative/LaunchdarklyReactNativeClientModule.java b/android/src/main/java/com/launchdarkly/reactnative/LaunchdarklyReactNativeClientModule.java index 5797202..38b0ee1 100644 --- a/android/src/main/java/com/launchdarkly/reactnative/LaunchdarklyReactNativeClientModule.java +++ b/android/src/main/java/com/launchdarkly/reactnative/LaunchdarklyReactNativeClientModule.java @@ -434,19 +434,30 @@ private ObjectBuilder objectBuilderFromDetail(EvaluationDetail detail) { ObjectBuilder resultMap = LDValue.buildObject(); if (!detail.isDefaultValue()) { resultMap.put("variationIndex", detail.getVariationIndex()); + } else { + resultMap.put("variationIndex", LDValue.ofNull()); } EvaluationReason reason = detail.getReason(); + if (reason == null) { + resultMap.put("reason", LDValue.ofNull()); + return resultMap; + } ObjectBuilder reasonMap = LDValue.buildObject(); reasonMap.put("kind", reason.getKind().name()); switch (reason.getKind()) { case RULE_MATCH: reasonMap.put("ruleIndex", reason.getRuleIndex()); - if (reason.getRuleId() != null) { - reasonMap.put("ruleId", reason.getRuleId()); + reasonMap.put("ruleId", reason.getRuleId()); + if (reason.isInExperiment()) { + reasonMap.put("inExperiment", true); } break; case PREREQUISITE_FAILED: reasonMap.put("prerequisiteKey", reason.getPrerequisiteKey()); break; case ERROR: reasonMap.put("errorKind", reason.getErrorKind().name()); break; + case FALLTHROUGH: + if (reason.isInExperiment()) { + reasonMap.put("inExperiment", true); + } default: break; } resultMap.put("reason", reasonMap.build()); diff --git a/package.json b/package.json index 10cf64c..a93c43b 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,7 @@ }, "homepage": "https://docs.launchdarkly.com/sdk/client-side/react-native", "peerDependencies": { - "react-native": ">=0.64.0 <0.68.0" + "react-native": ">=0.64.0 <0.69.0" }, "devDependencies": { "jest": "^26.6.3",