wkwebview

How to find UIWebView in Project and replace it with WKWebView?

被刻印的时光 ゝ 提交于 2020-05-29 05:36:34
问题 We identified one or more issues with a recent delivery for your app, "App Name" 1.0 (5.0). Please correct the following issues, then upload again. ITMS-90809: Deprecated API Usage - New apps that use UIWebView are no longer accepted. Instead, use WKWebView for improved security and reliability. Learn more (https://developer.apple.com/documentation/uikit/uiwebview). Best regards, The App Store Team Getting above email from no_reply@email.apple.com while uploading build. I've not used

WKWebView: How to handle BLOB URL

让人想犯罪 __ 提交于 2020-05-17 06:43:09
问题 I have my wkweview when I click on a file to download it I have a popup writing: "No application configured to open the URL blob:https// ... " I tried to register a custom URL scheme blob to wkwebview, the application crash saying that this scheme is already supported by default. However when I click on the file the delegate is not called: func webView(_ webView: WKWebView, decidePolicyFor navigationResponse: WKNavigationResponse, decisionHandler: @escaping (WKNavigationResponsePolicy) ->

WKWebView user-agent (swift)

家住魔仙堡 提交于 2020-05-16 03:10:06
问题 I'm trying to get the user-agent from WKWebView by using swift, let webView = WKWebView(frame: .zero) useragentlabel.text = webView.configuration.applicationNameForUserAgent but it return Mobile/15E148 , it s can be that the user-agent ? thanks 回答1: [self.webView evaluateJavaScript:@"navigator.userAgent" completionHandler:^(id _Nullable result, NSError * _Nullable error) { }]; The result is userAgent 回答2: This gets the user agent: let userAgent = webView.customUserAgent! 来源: https:/

WKWebView Won't Load (NSViewController, OS X)

删除回忆录丶 提交于 2020-05-14 17:18:42
问题 I am trying to build a simple WKWebView application that will display Google in the WebView. The app works perfectly fine; however, upon implementing the WKWebView, the app no longer shows a window. It just simply launches the app (in the dock) with no NSView in sight. ViewController.swift import Cocoa import WebKit class ViewController: NSViewController { var webView: WKWebView? override func loadView() { self.webView = WKWebView() self.view = self.webView! let url = NSURL(string:"http://www

Force WKWebView to show mobile version

这一生的挚爱 提交于 2020-05-13 13:42:27
问题 I am trying to force WKWebView to show mobile version. I am getting inconsistent results across app versions. But, safari always sows mobile correctly. I have tried setting the userAgent, nothing seems to affect the view. 回答1: On iOS 9 version of WKWebView, there is a property customUserAgent. Please, try to change this property : // User Agent webview.customUserAgent = @"Mozilla/5.0 (iPod; U; CPU iPhone OS 4_3_3 like Mac OS X; ja-jp) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2

How to add Activity Indicator to WKWebView (Swift 3)

一曲冷凌霜 提交于 2020-05-10 04:35:53
问题 I have a wkwebview in my app, and I want to add an activity indicator to it. I want it to where it appears when the webview is loading and disappears whenever it is finished loading, it disappears. Can you give me some code to do this? Here's my code right now: @IBOutlet weak var Activity: UIActivityIndicatorView! var webView : WKWebView! @IBOutlet var containerView: UIView? = nil override func viewDidLoad() { super.viewDidLoad() guard let url = URL(string: "http://ifunnyvlogger.wixsite.com

How to add Activity Indicator to WKWebView (Swift 3)

半世苍凉 提交于 2020-05-10 04:35:25
问题 I have a wkwebview in my app, and I want to add an activity indicator to it. I want it to where it appears when the webview is loading and disappears whenever it is finished loading, it disappears. Can you give me some code to do this? Here's my code right now: @IBOutlet weak var Activity: UIActivityIndicatorView! var webView : WKWebView! @IBOutlet var containerView: UIView? = nil override func viewDidLoad() { super.viewDidLoad() guard let url = URL(string: "http://ifunnyvlogger.wixsite.com

iOS 13 - WkWebView: audio stops when in background

倖福魔咒の 提交于 2020-05-09 17:57:46
问题 I've an app that uses WkWebView to play audio from Soundcloud, on iOS 13 Beta 6 the audio stops when the app is not in foreground, even when Audio is on in Background Modes . When starting the playback this assertions is thrown: Error acquiring assertion: <NSError: 0x282cf67c0; domain: RBSAssertionErrorDomain; code: 2; reason: "Required client entitlement is missing"> { userInfo = { RBSAssertionAttribute = <RBSLegacyAttribute: 0x1592432e0; requestedReason: MediaPlayback; reason: MediaPlayback

Capture redirect url in wkwebview in ios

≯℡__Kan透↙ 提交于 2020-05-07 11:27:05
问题 How do I capture the redirection url in when using WKWebView like if a webpage redirects to another page on submitting the username and password or some other data. I need to capture the redirected url. Is there any method in WKNavigationDelegate to override? 回答1: Use this WKNavigationDelegate method public func webView(_ webView: WKWebView, decidePolicyFor navigationAction: WKNavigationAction, decisionHandler: @escaping (WKNavigationActionPolicy) -> Swift.Void) { if(navigationAction

Capture redirect url in wkwebview in ios

半腔热情 提交于 2020-05-07 11:26:10
问题 How do I capture the redirection url in when using WKWebView like if a webpage redirects to another page on submitting the username and password or some other data. I need to capture the redirected url. Is there any method in WKNavigationDelegate to override? 回答1: Use this WKNavigationDelegate method public func webView(_ webView: WKWebView, decidePolicyFor navigationAction: WKNavigationAction, decisionHandler: @escaping (WKNavigationActionPolicy) -> Swift.Void) { if(navigationAction