Skip to content

MOB-11657 Issues with timing of in app message display #925

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 13 commits into
base: master
Choose a base branch
from

Conversation

joaodordio
Copy link
Member

@joaodordio joaodordio commented Jul 23, 2025

🔹 Jira Ticket(s)

✏️ Description

Problem 1: SDK needed a real-time control over when in-app messages can be displayed, rather than relying on the static isAutoDisplayPaused property.

Solution:

  • Created IterableInAppDisplayDelegate protocol with isAutoDisplayPaused(for:) method
  • Added inAppDisplayDelegate property to IterableConfig
  • Modified InAppManager.isOkToShowNow() to call the delegate for real-time decision making
  • Updated dependency injection to pass the delegate through the system

Problem 2: The 0.75-second delay happened after getting the view controller, causing issues when app state changed during the delay.

Solution:

  • Restructured InAppPresenter to change the timing sequence to: delay → check → get view controller → present
  • Modified InAppDisplayer to defer view controller lookup and validation until after the delay
  • Added post-delay validation to ensure the presentation context is still valid

sumeruchat and others added 9 commits June 24, 2025 16:14
…S 13+ multi-window support

- Add iOS 13+ multi-window scene detection to IterableUtil.rootViewController
- Prioritize foregroundActive scenes and key windows for InApp display
- Maintain backward compatibility with iOS 12 and single-window apps
- Fixes Stage Manager and multi-window scenarios on iPad
- Use scene.keyWindow property on iOS 15+ instead of isKeyWindow filter
- isKeyWindow can return false for all windows on iOS 15+ with Stage Manager
- Maintain iOS 13-14 compatibility with existing isKeyWindow approach
- Resolves window detection issues in multi-window scenarios
@joaodordio joaodordio self-assigned this Jul 23, 2025
Copy link

codecov bot commented Jul 23, 2025

Codecov Report

❌ Patch coverage is 73.91304% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 68.91%. Comparing base (6e2fdec) to head (4b4df7d).
⚠️ Report is 876 commits behind head on master.

Files with missing lines Patch % Lines
swift-sdk/Internal/in-app/InAppPresenter.swift 58.33% 5 Missing ⚠️
swift-sdk/Internal/in-app/InAppDisplayer.swift 83.33% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           master     #925       +/-   ##
===========================================
- Coverage   85.19%   68.91%   -16.28%     
===========================================
  Files          91      104       +13     
  Lines        6301     7598     +1297     
===========================================
- Hits         5368     5236      -132     
- Misses        933     2362     +1429     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

2 participants