From 323f147f8715fa91550119cab7b382c8f416483d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Ferr=C3=A3o?= Date: Sat, 10 Oct 2026 12:02:45 +0100 Subject: [PATCH 1/2] feat(SDK-553): expose IterableConfig.eventThresholdLimit Wire the unknown-user local event cap through iOS and Android Serialization. --- CHANGELOG.md | 6 ++++++ .../java/com/iterable/reactnative/Serialization.java | 5 +++++ ios/RNIterableAPI/Serialization.swift | 4 ++++ src/core/classes/Iterable.test.ts | 9 +++++++++ src/core/classes/IterableConfig.ts | 10 ++++++++++ 5 files changed, 34 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 771a9fca4..cb98f9c5f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## Unreleased + +### Updates + +- Added `IterableConfig.eventThresholdLimit` (default `100`) to cap locally stored unknown-user events before identification (SDK-553). Applies when unknown-user activation is enabled on the native SDK. + ## 3.2.1 ### Fixes diff --git a/android/src/main/java/com/iterable/reactnative/Serialization.java b/android/src/main/java/com/iterable/reactnative/Serialization.java index 97aa52f49..51c5d3368 100644 --- a/android/src/main/java/com/iterable/reactnative/Serialization.java +++ b/android/src/main/java/com/iterable/reactnative/Serialization.java @@ -201,6 +201,11 @@ static IterableConfig.Builder getConfigFromReadableMap(ReadableMap iterableConte configBuilder.setExpiringAuthTokenRefreshPeriod(iterableContextJSON.optLong("expiringAuthTokenRefreshPeriod")); } + if (iterableContextJSON.has("eventThresholdLimit")) { + configBuilder.setEventThresholdLimit( + iterableContextJSON.optInt("eventThresholdLimit", 100)); + } + if (iterableContextJSON.has("useInMemoryStorageForInApps") || iterableContextJSON.has("androidSdkUseInMemoryStorageForInApps")) { configBuilder.setUseInMemoryStorageForInApps(iterableContextJSON.optBoolean("useInMemoryStorageForInApps")); } diff --git a/ios/RNIterableAPI/Serialization.swift b/ios/RNIterableAPI/Serialization.swift index fee4c49b6..b0b1bda2c 100644 --- a/ios/RNIterableAPI/Serialization.swift +++ b/ios/RNIterableAPI/Serialization.swift @@ -75,6 +75,10 @@ extension IterableConfig { config.expiringAuthTokenRefreshPeriod = expiringAuthTokenRefreshPeriod } + if let eventThresholdLimit = dict["eventThresholdLimit"] as? Int { + config.eventThresholdLimit = eventThresholdLimit + } + if let logLevelNumber = dict["logLevel"] as? NSNumber { config.logDelegate = createLogDelegate(logLevelNumber: logLevelNumber) } diff --git a/src/core/classes/Iterable.test.ts b/src/core/classes/Iterable.test.ts index baccc3e41..53e8dd69a 100644 --- a/src/core/classes/Iterable.test.ts +++ b/src/core/classes/Iterable.test.ts @@ -328,6 +328,7 @@ describe('Iterable', () => { expect(config.enableEmbeddedMessaging).toBe(false); expect(config.encryptionEnforced).toBe(false); expect(config.expiringAuthTokenRefreshPeriod).toBe(60.0); + expect(config.eventThresholdLimit).toBe(100); expect(config.inAppDisplayInterval).toBe(30.0); expect(config.inAppHandler).toBe(undefined); expect(config.logLevel).toBe(IterableLogLevel.debug); @@ -347,6 +348,7 @@ describe('Iterable', () => { expect(configDict.enableEmbeddedMessaging).toBe(false); expect(configDict.encryptionEnforced).toBe(false); expect(configDict.expiringAuthTokenRefreshPeriod).toBe(60.0); + expect(configDict.eventThresholdLimit).toBe(100); expect(configDict.inAppDisplayInterval).toBe(30.0); expect(configDict.inAppHandlerPresent).toBe(false); expect(configDict.logLevel).toBe(IterableLogLevel.debug); @@ -365,6 +367,13 @@ describe('Iterable', () => { expect(configDict.androidWakeDelayMs).toBe(1500); expect(configDict.authCallbackTimeoutMs).toBe(2500); }); + + it('should include eventThresholdLimit in toDict() when overridden', () => { + const config = new IterableConfig(); + config.eventThresholdLimit = 50; + const configDict = config.toDict(); + expect(configDict.eventThresholdLimit).toBe(50); + }); }); describe('urlHandler', () => { diff --git a/src/core/classes/IterableConfig.ts b/src/core/classes/IterableConfig.ts index b4de2fb41..a262c2613 100644 --- a/src/core/classes/IterableConfig.ts +++ b/src/core/classes/IterableConfig.ts @@ -262,6 +262,15 @@ export class IterableConfig { */ expiringAuthTokenRefreshPeriod = 60.0; + /** + * Maximum number of unknown-user (anonymous) events stored locally before + * identification. The native SDK drops the oldest events when the count + * exceeds this limit. + * + * Applies when unknown-user activation is enabled on the native SDK. + */ + eventThresholdLimit = 100; + /** * Use this array to declare the specific URL protocols that the SDK can * expect to see on incoming links from Iterable, so it knows that it can @@ -476,6 +485,7 @@ export class IterableConfig { /** The log level for the SDK. */ logLevel: this.logLevel, expiringAuthTokenRefreshPeriod: this.expiringAuthTokenRefreshPeriod, + eventThresholdLimit: this.eventThresholdLimit, allowedProtocols: this.allowedProtocols, androidSdkUseInMemoryStorageForInApps: this.androidSdkUseInMemoryStorageForInApps, From c5143d6c0c57b693ef7b5037526b414ba6ba2cf4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Ferr=C3=A3o?= Date: Sat, 10 Oct 2026 12:12:59 +0100 Subject: [PATCH 2/2] docs(SDK-553): note eventThresholdLimit is inert until UUA is exposed Clarify changelog and TSDoc: RN has no enableUnknownUserActivation yet. --- CHANGELOG.md | 2 +- src/core/classes/IterableConfig.ts | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cb98f9c5f..d2e73b9c5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ ### Updates -- Added `IterableConfig.eventThresholdLimit` (default `100`) to cap locally stored unknown-user events before identification (SDK-553). Applies when unknown-user activation is enabled on the native SDK. +- Added `IterableConfig.eventThresholdLimit` (default `100`) to cap locally stored unknown-user events before identification (SDK-553). The value is forwarded to the native SDK; it has no runtime effect in React Native until `enableUnknownUserActivation` is exposed in a future release (that switch is not on the RN config surface yet). ## 3.2.1 diff --git a/src/core/classes/IterableConfig.ts b/src/core/classes/IterableConfig.ts index a262c2613..e30639bbd 100644 --- a/src/core/classes/IterableConfig.ts +++ b/src/core/classes/IterableConfig.ts @@ -267,7 +267,10 @@ export class IterableConfig { * identification. The native SDK drops the oldest events when the count * exceeds this limit. * - * Applies when unknown-user activation is enabled on the native SDK. + * The value is sent to the native SDK at init. React Native does not expose + * `enableUnknownUserActivation` yet, so this limit has no observable effect + * until that option is added; when it is, the limit applies only while + * unknown-user activation is enabled. */ eventThresholdLimit = 100;