Allow WebViewCookies option to be passed through#139
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds support for passing the allowWebViewCookies configuration option from the React Native (JS) layer through to the Android native SDK, enabling apps to opt into preserving cookies for SDK WebViews.
Changes:
- Extends the JS
AndroidConfigurationtyping withallowWebViewCookies?: boolean. - Parses
android.allowWebViewCookiesin the AndroidConfigurationParserand applies it ontoExponeaConfiguration.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
src/Configuration.ts |
Adds the new Android configuration option to the public TS interface. |
android/src/main/java/com/exponea/ConfigurationParser.kt |
Passes the new allowWebViewCookies key through to the underlying ExponeaConfiguration. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| "allowWebViewCookies" -> | ||
| configuration.allowWebViewCookies = map.getSafely("allowWebViewCookies", Boolean::class) |
There was a problem hiding this comment.
Native parsing logic now supports the allowWebViewCookies key, but there are already unit tests for ConfigurationParser (e.g., parsing configurationComplete.json) and none currently assert this new field is actually applied. Please add/extend a test case to parse an android config containing allowWebViewCookies: true and assert the resulting ExponeaConfiguration.allowWebViewCookies is set accordingly.
9b96d57 to
ebb9a0f
Compare
ebb9a0f to
3a4b0ba
Compare
The React Native SDK does not currently allow for the
allowWebViewCookiesoption to be passed through to the Android SDK, which means it will always default tofalse, thereby disabling cookies at a global level across the entire app.We have a usecase where we need this setting to be set to
true, but we can't callExponea.configureat the Android SDK level.This change allows this option to be passed through via the JS SDK.
We woudl be grateful if this change could be back-ported to 2.6 and 2.7 versions of the SDK as well, to allow us to use this option without migrating to the latest major version.