Skip to content

Allow WebViewCookies option to be passed through#139

Open
helblinglilly wants to merge 1 commit into
exponea:mainfrom
helblinglilly:android-pass-throuhg-webview-cookies
Open

Allow WebViewCookies option to be passed through#139
helblinglilly wants to merge 1 commit into
exponea:mainfrom
helblinglilly:android-pass-throuhg-webview-cookies

Conversation

@helblinglilly

Copy link
Copy Markdown

The React Native SDK does not currently allow for the allowWebViewCookies option to be passed through to the Android SDK, which means it will always default to false, 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 call Exponea.configure at 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.

Copilot AI review requested due to automatic review settings April 17, 2026 10:57

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 AndroidConfiguration typing with allowWebViewCookies?: boolean.
  • Parses android.allowWebViewCookies in the Android ConfigurationParser and applies it onto ExponeaConfiguration.

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.

Comment on lines +236 to +237
"allowWebViewCookies" ->
configuration.allowWebViewCookies = map.getSafely("allowWebViewCookies", Boolean::class)

Copilot AI Apr 17, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Comment thread src/Configuration.ts Outdated
Comment thread src/Configuration.ts Outdated
@helblinglilly helblinglilly force-pushed the android-pass-throuhg-webview-cookies branch 2 times, most recently from 9b96d57 to ebb9a0f Compare April 17, 2026 11:20
@helblinglilly helblinglilly force-pushed the android-pass-throuhg-webview-cookies branch from ebb9a0f to 3a4b0ba Compare April 17, 2026 11:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants