Open
Conversation
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) |
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.
🔹 Jira Ticket(s) if any
✏️ Description
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.