diff --git a/.gitignore b/.gitignore index f1bd0f34c..715ddd6e7 100644 --- a/.gitignore +++ b/.gitignore @@ -39,3 +39,4 @@ CI.swift *.mdb .build/arm64-apple-macosx/debug/IterableSDK.build/output-file-map.json .build +.mcp.json diff --git a/swift-sdk/Internal/IterableHtmlMessageViewController.swift b/swift-sdk/Internal/IterableHtmlMessageViewController.swift index 215214c9d..90bea797e 100644 --- a/swift-sdk/Internal/IterableHtmlMessageViewController.swift +++ b/swift-sdk/Internal/IterableHtmlMessageViewController.swift @@ -224,11 +224,24 @@ class IterableHtmlMessageViewController: UIViewController { /// Resizes the webview based upon the insetPadding, height etc private func resizeWebView(animate: Bool) { - let parentPosition = ViewPosition(width: view.bounds.width, + // For full position, use screen bounds to ensure edge-to-edge coverage + // including behind notch/Dynamic Island and home indicator + let parentPosition: ViewPosition + if location == .full { + let screenBounds = UIScreen.main.bounds + // Convert screen center to view's coordinate system + let screenCenterInView = view.convert(CGPoint(x: screenBounds.midX, y: screenBounds.midY), from: nil) + parentPosition = ViewPosition(width: screenBounds.width, + height: screenBounds.height, + center: screenCenterInView) + } else { + parentPosition = ViewPosition(width: view.bounds.width, height: view.bounds.height, center: view.center) + } + let safeAreaInsets = InAppCalculations.safeAreaInsets(for: view) IterableHtmlMessageViewController.calculateWebViewPosition(webView: webView, - safeAreaInsets: InAppCalculations.safeAreaInsets(for: view), + safeAreaInsets: safeAreaInsets, parentPosition: parentPosition, paddingLeft: CGFloat(parameters.padding.left), paddingRight: CGFloat(parameters.padding.right), diff --git a/swift-sdk/Internal/Utilities/WebViewProtocol.swift b/swift-sdk/Internal/Utilities/WebViewProtocol.swift index 13cf7380a..06a0e5b3e 100644 --- a/swift-sdk/Internal/Utilities/WebViewProtocol.swift +++ b/swift-sdk/Internal/Utilities/WebViewProtocol.swift @@ -39,7 +39,7 @@ extension WKWebView: WebViewProtocol { func set(navigationDelegate: WKNavigationDelegate?) { self.navigationDelegate = navigationDelegate } - + func calculateHeight() -> Pending { let fulfill = Fulfill() diff --git a/tests/business-critical-integration/integration-test-app/IterableSDK-Integration-Tester/App/InAppMessage/InAppMessageTestView.swift b/tests/business-critical-integration/integration-test-app/IterableSDK-Integration-Tester/App/InAppMessage/InAppMessageTestView.swift index 704c7ca16..dcc905b8c 100644 --- a/tests/business-critical-integration/integration-test-app/IterableSDK-Integration-Tester/App/InAppMessage/InAppMessageTestView.swift +++ b/tests/business-critical-integration/integration-test-app/IterableSDK-Integration-Tester/App/InAppMessage/InAppMessageTestView.swift @@ -111,7 +111,17 @@ struct InAppMessageTestView: View { } .accessibilityIdentifier("trigger-testview-in-app-button") .disabled(viewModel.isTriggeringCampaign) - + + ActionButton( + title: "Send Full Screen In-App (SDK-31 Test)", + backgroundColor: Color(.systemPurple), + isLoading: viewModel.isTriggeringCampaign + ) { + viewModel.triggerCampaign(16505358) + } + .accessibilityIdentifier("trigger-fullscreen-in-app-button") + .disabled(viewModel.isTriggeringCampaign) + ActionButton( title: "Send Silent Push (Campaign 14750476)", backgroundColor: Color(.brown), diff --git a/tests/common/MockWebView.swift b/tests/common/MockWebView.swift index b1bdc4013..cf560832b 100644 --- a/tests/common/MockWebView.swift +++ b/tests/common/MockWebView.swift @@ -9,30 +9,30 @@ import WebKit class MockWebView: WebViewProtocol { let view: UIView = UIView() - + func loadHTMLString(_: String, baseURL _: URL?) -> WKNavigation? { nil } - + func set(position: ViewPosition) { self.position = position view.frame.size.width = position.width view.frame.size.height = position.height view.center = position.center } - + func set(navigationDelegate _: WKNavigationDelegate?) {} - + func layoutSubviews() {} - + func calculateHeight() -> Pending { Fulfill(value: height) } - + var position: ViewPosition = ViewPosition() - + private var height: CGFloat - + init(height: CGFloat) { self.height = height }