From 6c4d4067f00b065a90fd1ad050aabeadf6c66b00 Mon Sep 17 00:00:00 2001 From: Apekka Date: Thu, 25 Jul 2024 17:16:25 +0200 Subject: [PATCH] add webview inspection --- ios/MessageWebViewWrapper.swift | 4 ++++ src/types.ts | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ios/MessageWebViewWrapper.swift b/ios/MessageWebViewWrapper.swift index eb518036..da723a6b 100644 --- a/ios/MessageWebViewWrapper.swift +++ b/ios/MessageWebViewWrapper.swift @@ -67,6 +67,10 @@ class _MessageWebViewWrapper: NSObject, UANavigationDelegate, NativeBridgeDelega self.nativeBridge.nativeBridgeDelegate = self self.webView.navigationDelegate = self.nativeBridge self.webView.configuration.dataDetectorTypes = .all + + if #available(iOS 16.4, *) { + self.webView.isInspectable = Airship.isFlying && Airship.config.isWebViewInspectionEnabled + } } @MainActor diff --git a/src/types.ts b/src/types.ts index ae7da1f6..7ee483f6 100644 --- a/src/types.ts +++ b/src/types.ts @@ -481,11 +481,15 @@ export interface AirshipConfig { */ itunesId?: string; - /** * If set to `true`, the SDK will use the preferred locale. Otherwise it will use the app's locale. */ useUserPreferredLocale?: boolean; + + /** + * Allows the WebViews to be inspected in Safari. + */ + isWebViewInspectionEnabled?: boolean; }; /**