From d8d84053bc1727269a4f8be9b4b38485dc111c0d Mon Sep 17 00:00:00 2001 From: sunalwaysknows <86180691+sunalwaysknows@users.noreply.github.com> Date: Sat, 26 Feb 2022 11:06:25 +0800 Subject: [PATCH 1/2] Update: Append optional applicationNameForUserAgent to configrational applicationNameForUserAgent --- ios/Classes/InAppWebView/InAppWebView.swift | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ios/Classes/InAppWebView/InAppWebView.swift b/ios/Classes/InAppWebView/InAppWebView.swift index f49fcef7d..8ad012957 100755 --- a/ios/Classes/InAppWebView/InAppWebView.swift +++ b/ios/Classes/InAppWebView/InAppWebView.swift @@ -499,6 +499,11 @@ public class InAppWebView: WKWebView, UIScrollViewDelegate, WKUIDelegate, WKNavi } else if options.cacheEnabled { configuration.websiteDataStore = WKWebsiteDataStore.default() } + if !options.applicationNameForUserAgent.isEmpty { + if let applicationNameForUserAgent = configuration.applicationNameForUserAgent { + configuration.applicationNameForUserAgent = applicationNameForUserAgent + " " + options.applicationNameForUserAgent + } + } } if #available(iOS 10.0, *) { From af460d674659157acbdcbb8d5d0859b98f31d749 Mon Sep 17 00:00:00 2001 From: Lorenzo Pichilli Date: Fri, 15 Apr 2022 20:35:23 +0200 Subject: [PATCH 2/2] Update InAppWebView.swift removed setting `applicationNameForUserAgent` property from `prepare` method. --- ios/Classes/InAppWebView/InAppWebView.swift | 3 --- 1 file changed, 3 deletions(-) diff --git a/ios/Classes/InAppWebView/InAppWebView.swift b/ios/Classes/InAppWebView/InAppWebView.swift index 8ad012957..23f2fcdab 100755 --- a/ios/Classes/InAppWebView/InAppWebView.swift +++ b/ios/Classes/InAppWebView/InAppWebView.swift @@ -405,9 +405,6 @@ public class InAppWebView: WKWebView, UIScrollViewDelegate, WKUIDelegate, WKNavi if #available(iOS 9.0, *) { configuration.allowsAirPlayForMediaPlayback = options.allowsAirPlayForMediaPlayback configuration.allowsPictureInPictureMediaPlayback = options.allowsPictureInPictureMediaPlayback - if !options.applicationNameForUserAgent.isEmpty { - configuration.applicationNameForUserAgent = options.applicationNameForUserAgent - } } configuration.preferences.javaScriptCanOpenWindowsAutomatically = options.javaScriptCanOpenWindowsAutomatically