Skip to content

[SDK-100] compose support#1015

Open
franco-zalamena-iterable wants to merge 6 commits intomasterfrom
SDK-100-compose-support
Open

[SDK-100] compose support#1015
franco-zalamena-iterable wants to merge 6 commits intomasterfrom
SDK-100-compose-support

Conversation

@franco-zalamena-iterable
Copy link
Copy Markdown
Contributor

@franco-zalamena-iterable franco-zalamena-iterable commented Apr 6, 2026

🔹 Jira Ticket(s) if any

✏️ Description

  • Add Dialog-based in-app message display for Compose apps using ComponentActivity (existing Fragment path unchanged)
  • Extract shared logic into service classes (layout, animation, tracking, orientation, webview)
  • Fix activity recreation state handling to prevent duplicate trackInAppOpen calls
  • Add volatile to static singleton fields for thread-safe cross-thread reads

Why?

The SDK's in-app display requires FragmentActivity, which pure Compose apps don't use. This adds a Dialog-based fallback that activates automatically when the host activity is a ComponentActivity.

franco-zalamena-iterable and others added 6 commits April 6, 2026 10:35
Prevent duplicate trackInAppOpen calls when the activity is recreated
(e.g. rotation) by saving/restoring the inAppOpenTracked flag via
onSaveInstanceState. Also preserve static singleton state during
configuration changes to match Fragment version behavior.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Tests cover singleton lifecycle (create/getInstance/dismiss), dialog
show/dismiss behavior, URL click handling, layout variants
(fullscreen/top/bottom/center), duplicate display rejection, and
resilience to resize after dismiss.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The static notification/clickCallback/location fields can be read from
background threads (e.g. processMessages after network sync) while
being written on the main thread during show/dismiss. Mark them
volatile to ensure cross-thread visibility in both the Fragment and
Dialog in-app notification classes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
callbacks: IterableWebView.HTMLNotificationCallbacks,
htmlContent: String
): IterableWebView {
val webView = IterableWebView(context)
val loc = location ?: IterableInAppLocation.IN_APP

if (iterableApi != null) {
iterableApi.trackInAppOpen(messageId, loc)
val loc = location ?: IterableInAppLocation.IN_APP

if (iterableApi != null) {
iterableApi.trackInAppClick(messageId, url, loc)
val loc = location ?: IterableInAppLocation.IN_APP

if (iterableApi != null) {
iterableApi.trackInAppClose(messageId, url, closeAction, loc)
@franco-zalamena-iterable franco-zalamena-iterable changed the title Sdk 100 compose support [SDK-100] compose support Apr 6, 2026
@franco-zalamena-iterable franco-zalamena-iterable linked an issue Apr 8, 2026 that may be closed by this pull request
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.

compose compatibility

2 participants