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] 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 f49fcef7..8ad01295 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, *) {