diff --git a/CHANGELOG.md b/CHANGELOG.md index defeb1ea..ae237dc5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # browser-switch-android Release Notes +## unreleased + * Add a UUID to `BrowserSwitchActivityRegistryKey` used to start AuthTab flows to allow for multiple instances of + BrowserSwitchClient to have separate keys to deliver results to. Fixes an issue where multiple + BrowserSwitchClient instances are not supported. + ## 3.5.0 * Add parameterized constructor `BrowserSwitchClient(ActivityResultRegistry)` for AuthTab support on Jetpack Compose * Bump `androidx.browser` to `1.10.0-alpha02` diff --git a/browser-switch/src/main/java/com/braintreepayments/api/BrowserSwitchClient.java b/browser-switch/src/main/java/com/braintreepayments/api/BrowserSwitchClient.java index e11db2c4..edf3926e 100644 --- a/browser-switch/src/main/java/com/braintreepayments/api/BrowserSwitchClient.java +++ b/browser-switch/src/main/java/com/braintreepayments/api/BrowserSwitchClient.java @@ -19,6 +19,8 @@ import org.json.JSONObject; +import java.util.UUID; + /** * Client that manages the logic for browser switching. */ @@ -29,7 +31,7 @@ public class BrowserSwitchClient { private ActivityResultLauncher authTabLauncher; private BrowserSwitchRequest pendingAuthTabRequest; - final String registryKey = "BrowserSwitchActivityRegistryKey"; + final String registryKey = "BrowserSwitchActivityRegistryKey"+ UUID.randomUUID(); @Nullable private BrowserSwitchFinalResult authTabCallbackResult;