Repository navigation
[SDK-792] fix(ios): reject showMessage for an empty or unknown message id - #920
Merged
Merged
Conversation
… compiles against native 3.10.1 The published iterableapi 3.10.1 AAR is compiled with Kotlin 1.9 without jvm-default, so onEmbeddedMessagingSyncSucceeded and onEmbeddedMessagingSyncFailed are abstract to Java implementers. RNIterableAPIModuleImpl did not override them, so the module failed javac. Add no-op overrides that match the native defaults.
Iterable.inAppManager.showMessage called IterableInAppManager.showMessage on the React Native native-modules thread. Since native Android 3.9.0, a host activity that is not a FragmentActivity takes the Dialog path, whose LifecycleRegistry.addObserver call throws IllegalStateException off the main thread and kills the process. - Post the native call with UiThreadUtil.runOnUiThread, matching setAutoDisplayPaused and the native iOS SDK. - Reject when the message id is missing instead of passing null into native (NPE). - Resolve null when the message is dismissed without a URL instead of NPE on toString. - Fix the empty messageId check, which used reference equality. Adds the first JVM unit tests for the Android bridge (Robolectric + Mockito, versions mirrored from iterable-android-sdk) and excludes them from the npm package.
…ge id The iOS bridge logged and returned without settling the promise. Reject with the same messages as the Android bridge.
|
Coverage Impact This PR will not change total coverage. 🚦 See full report on Qlty Cloud »🛟 Help
|
jferrao-itrbl
approved these changes
Oct 8, 2026
8 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

📝 Summary
Reject
showMessageon iOS for an empty or unknown message id, matching the Android bridge after #918.🎟️ Jira Ticket: SDK-792
📖 Description
ReactIterableAPI.showMessageloggedITBErrorand returned without calling the resolver or rejecter when the message id was not in the native queue, so the JS promise never settled. An empty id was not checked at all.It now rejects with the same code and messages as Android (
messageId is null or empty,Could not find message with id: <id>), using the samerejecterpattern asgetHtmlInAppContentin this file.Stacked on #918. Branch is cut from #918 so the CHANGELOG lands under the same
## 3.2.1section. The diff shrinks to three files once #918 merges.🧪 How to test?
yarn test(addsshowMessage_nativeRejects_propagatesRejectionToJs, which checks a native rejection reaches the JS caller; the reject strings themselves live in the Swift guards)xcodebuild ... -sdk iphonesimulator build, BUILD SUCCEEDED)Iterable.inAppManager.showMessagewith a message that was consumed elsewhere, expect a rejection instead of a hanging promise🧾 Changelog
Added under
## 3.2.1.📚 Docs PR if applicable
Covered by SDK-793.