iOS Simulator WebView投掷“超时”发生了。
我正在执行一个简单的移动应用程序,该应用程序嵌入wkwebview
使用ionic 6
+ angular
。
我已经在MacBook上使用Chrome和Safari测试了我的网站,一切都很好,直到我在wkwebview
控制上打开它。
首先,我的WebView成功显示(如下图)
当我单击提交
按钮时,我的ionic 6
网站将调用API端点&继续下载一些块,然后转到下一页。
但是,这是我在提交
按钮之后得到的:
错误消息是:
[Error] ERROR
Object
info: {meta: null, lastValue: null, seen: 0}
message: "Timeout has occurred"
name: "TimeoutError"
stack: "@http://****/main.02dd4c6bece51f6f.js:1:175858↵@http://****/main.02dd4c6bece51f6f.js:1:43982…"
这是我设置我的WebView的方式:
func setupWebView() {
let url = URL(string: "http://<my-end-point>/")!
let request: URLRequest = URLRequest(url: url, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 180)
webView.load(request)
webView.allowsBackForwardNavigationGestures = true
webView.configuration.userContentController.add(self, name: listenerName)
}
我的问题是:
- 我可以增加
wkwebview
的超时到通过此问题? - 我还没有将应用程序部署到物理设备上,是模拟器的问题吗?还是物理设备问题?
I'm doing a simple mobile application which embeds a WkWebView
to display my website using Ionic 6
+ Angular
.
I have tested my website with Chrome and Safari on Macbook, everything was fine until I opened it on my WKWebView
control.
At first, my webview displayed successfully (as the below image)
When I clicked Submit
button, my Ionic 6
website would call an API Endpoint & continued download some chunks and go to the next page.
However, this is what I got after Submit
button has been clicked:
The error message was:
[Error] ERROR
Object
info: {meta: null, lastValue: null, seen: 0}
message: "Timeout has occurred"
name: "TimeoutError"
stack: "@http://****/main.02dd4c6bece51f6f.js:1:175858↵@http://****/main.02dd4c6bece51f6f.js:1:43982…"
This is how I setup my webview:
func setupWebView() {
let url = URL(string: "http://<my-end-point>/")!
let request: URLRequest = URLRequest(url: url, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 180)
webView.load(request)
webView.allowsBackForwardNavigationGestures = true
webView.configuration.userContentController.add(self, name: listenerName)
}
My question is:
- Can I increase the timeout of
WKWebView
to by pass this issue ? - I haven't deployed my app onto physical device, is it an issue of simulator only ? or it is physical device issue also ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论