Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions android/src/main/java/com/exponea/ConfigurationParser.kt
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,8 @@ internal class ConfigurationParser(private val readableMap: ReadableMap) {
)
}
}
"allowWebViewCookies" ->
configuration.allowWebViewCookies = map.getSafely("allowWebViewCookies", Boolean::class)
Comment on lines +243 to +244

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.
}
}
}
Expand Down
14 changes: 13 additions & 1 deletion android/src/test/java/com/exponea/ConfigurationParserTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ internal class ConfigurationParserTest {
pushChannelId = "mock-push-channel-id",
pushNotificationImportance = NotificationManager.IMPORTANCE_HIGH,
httpLoggingLevel = ExponeaConfiguration.HttpLoggingLevel.BODY,
allowDefaultCustomerProperties = false
allowDefaultCustomerProperties = false,
allowWebViewCookies = true
),
ConfigurationParser(data as ReadableMap).parse()
)
Expand Down Expand Up @@ -179,4 +180,15 @@ internal class ConfigurationParserTest {
val config = ConfigurationParser(data as ReadableMap).parse()
assertEquals(false, config.requirePushAuthorization)
}

@Test
fun `allowWebViewCookies should default to false when not set`() {
val data = JavaOnlyMap.of(
"projectToken", "mock-project-token",
"authorizationToken", "mock-authorization-token"
)
val config = ConfigurationParser(data as ReadableMap).parse()
assertEquals(false, config.allowWebViewCookies)
}

}
2 changes: 2 additions & 0 deletions src/Configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ export interface AndroidConfiguration {
pushNotificationImportance?: PushNotificationImportance;
/** Level of HTTP logging */
httpLoggingLevel?: HttpLoggingLevel;
/** If true, allows the Exponea SDK WebViews to accept and store cookies without clearing global app cookies */
allowWebViewCookies?: boolean;
}

export interface IOSConfiguration {
Expand Down
1 change: 1 addition & 0 deletions src/__tests__/Configuration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ test('should construct full configuration', () => {
pushNotificationImportance: PushNotificationImportance.HIGH,
httpLoggingLevel: HttpLoggingLevel.BODY,
requirePushAuthorization: false,
allowWebViewCookies: true,
},
ios: {
requirePushAuthorization: false,
Expand Down
8 changes: 6 additions & 2 deletions src/test_data/configurationComplete.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@
"string": "value",
"boolean": false,
"number": 3.14159,
"array": ["value1", "value2"],
"array": [
"value1",
"value2"
],
"object": {
"key": "value"
}
Expand All @@ -33,7 +36,8 @@
"pushChannelId": "mock-push-channel-id",
"pushNotificationImportance": "HIGH",
"httpLoggingLevel": "BODY",
"requirePushAuthorization": false
"requirePushAuthorization": false,
"allowWebViewCookies": true
},
"ios": {
"requirePushAuthorization": false,
Expand Down