英文:
PWABuilder app hanging sometimes after first opening the app on iphone
问题
我们已经在我们的SAP Spartacus平台上构建了一个新的渐进式Web应用程序(PWA),并使用PWABuilder.com网站创建了一个部署包,以便我们的客户可以在苹果应用商店找到该应用程序。部署包的创建进展得相当顺利,尽管我们尚未将应用提交给苹果进行审核,但我们已经在从TestFlight下载后的iPhone上进行了测试。
我们遇到了一个有点烦人的问题,似乎只在iPhone上发生,问题是当首次在iPhone上打开应用程序时,应用加载屏幕似乎会在最终让我们进入应用程序之前停滞不前,最长可达90秒。我们所有正在进行测试的人都使用了不同的iPhone,并且我们都遇到了这个问题。这个问题并不总是发生,有时候它只持续几秒钟,而不是整整90秒。这个问题在我们的Android测试手机上没有发生,当我们从桌面浏览器运行此应用程序时,似乎也不会发生。
在排除此问题时,我将我的iPhone连接到了我的Mac,并启动了应用程序,以便我可以在Xcode中看到控制台输出。我可以相当一致地看到问题发生如下,几秒钟后控制台中出现的一条消息是以下内容:
[ProcessSuspension] 0x15482a6b0 - TimedActivity::activityTimedOut:
经过一些搜索,这个问题似乎指向了WKWebView。我不是iPhone开发者,所以不太确定如何进一步排除此问题。我想也许可以尝试向PWABuilder提供的包中添加一些调试语句,以查找在出现问题时执行的确切代码行。
有人有什么建议,关于我还能做什么来排除这个问题?有人有关于可能引发此问题的原因的想法吗?
英文:
We have built a new Progressive Web Application (PWA) hosted in our SAP Spartacus platform, and we used the PWABuilder.com site to create a deployment package for the Apple app store so that our customers could find the app there. The creation of the deployment package went fairly well, and although we have yet to submit the app for review to Apple, we have been testing it on our iphones after downloading from TestFlight.
We've encountered a bit of an annoying problem that seems to be happening only on iphones, and the problem is that when first opening the app on the iphone, the app loading screen will appear to hang for up to 90 seconds before finally letting us in the app. All of us that are testing have used different iphones, and we all have encountered the problem. The problem doesn't always happen, and sometimes when it does happen, it only lasts a few seconds instead of the full 90 seconds. This problem is not happening on our Android test phones, and it also does not seem to happen when we run this app from a browser on our desktops.
In troubleshooting this problem, I've attached my iphone to my mac and started up the app so that I can see console output in xcode. I can pretty consistently see the problem occur like this, and a message that I see appear in the console after a few seconds is the following:
[ProcessSuspension] 0x15482a6b0 - TimedActivity::activityTimedOut:
After some googling, this problem seems to be pointing to WKWebView. I'm not an iphone developer so I'm not sure how to troubleshoot this further. I was thinking of maybe trying to add some debug statements to the package that PWABuilder provided to see if I could find the exact line of code that's executing when the problem happens.
Does anyone have any suggestions on what else I could do to troubleshoot this? Does anyone have any idea of what may be causing this issue?
答案1
得分: 1
我们解决了这个问题,问题出在服务工作者上。我不记得具体是关于服务工作者的哪个部分出了问题,但在对服务工作者代码进行一些调整之后,导致应用程序挂起的问题消失了。
英文:
We solved this problem, and it was due to the service worker. I don't remember specifically what it was about the service worker that was broken, but after some retooling of the service worker code, the problem with the hanging app went away.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论