diff --git a/.circleci/config.yml b/.circleci/config.yml index 54dc2c1..755e66e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -141,12 +141,16 @@ workflows: name: rn<>-xc<>-build-apps-using-template matrix: parameters: - rn-version: ["0.64.3", "0.65.2", "0.66.4", "0.67.3", "0.68.0","0.69.4"] - xcode-version: ["12.5.1", "13.2.1", "13.4.1"] + rn-version: ["0.64.3", "0.65.2", "0.66.4", "0.67.3", "0.68.0","0.69.4", "0.70.1"] + xcode-version: ["12.5.1", "13.2.1", "13.4.1", "14.0.1"] exclude: - rn-version: "0.64.3" xcode-version: "13.4.1" + - rn-version: "0.64.3" + xcode-version: "14.0.1" - rn-version: "0.65.2" xcode-version: "13.4.1" + - rn-version: "0.65.2" + xcode-version: "14.0.1" requires: - test-javascript diff --git a/android/build.gradle b/android/build.gradle index 8827b38..613eef9 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -45,7 +45,7 @@ allprojects { dependencies { implementation("com.facebook.react:react-native:+") - implementation("com.launchdarkly:launchdarkly-android-client-sdk:3.1.6") + implementation("com.launchdarkly:launchdarkly-android-client-sdk:3.2.0") implementation("com.jakewharton.timber:timber:5.0.1") implementation("com.google.code.gson:gson:2.8.9") } diff --git a/android/src/main/java/com/launchdarkly/reactnative/LaunchdarklyReactNativeClientModule.java b/android/src/main/java/com/launchdarkly/reactnative/LaunchdarklyReactNativeClientModule.java index 8f5f981..7a84d43 100644 --- a/android/src/main/java/com/launchdarkly/reactnative/LaunchdarklyReactNativeClientModule.java +++ b/android/src/main/java/com/launchdarkly/reactnative/LaunchdarklyReactNativeClientModule.java @@ -494,9 +494,21 @@ public void setOnline(Promise promise) { @ReactMethod public void isInitialized(String environment, Promise promise) { try { - boolean result = LDClient.getForMobileKey(environment).isInitialized(); - promise.resolve(result); + LDClient instance = LDClient.getForMobileKey(environment); + if (instance == null) { + promise.resolve(false); + } else { + boolean result = instance.isInitialized(); + promise.resolve(result); + } + } catch (LaunchDarklyException e) { + // Any known exception thrown by us means instances map is not there + // or the instances map has no key for the environment + // which means we should return isInitialized = false instead of promise rejection. + Timber.w(e); + promise.resolve(false); } catch (Exception e) { + Timber.w(e); promise.reject(ERROR_UNKNOWN, e); } }