Skip to content
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

bugfix iOS applicationNameForUserAgent #860

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions ios/Classes/InAppWebView/InAppWebView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,10 @@ public class InAppWebView: WKWebView, UIScrollViewDelegate, WKUIDelegate, WKNavi
} else if options.cacheEnabled {
configuration.websiteDataStore = WKWebsiteDataStore.default()
}

if !options.applicationNameForUserAgent.isEmpty {
configuration.applicationNameForUserAgent = options.applicationNameForUserAgent
}
Comment on lines +503 to +505
Copy link

@mrfour0004 mrfour0004 Jun 19, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We also had the similar issue and managed to solve this with a slightly different way. We append applicationNameForUserAgent instead of overriding it, because we noticed that some tracking parameters in URL link will be missing if we override the default applicationNameForUserAgent.

Could you help to check if appending applicationNameForUserAgent fixes your issue? If so, I think appending may be a safer way to deal with applicationNameForUserAgent.

}

if #available(iOS 10.0, *) {
Expand Down