Phonegap documentation表示如果应用程序遇到错误,可以让应用程序的浏览器包装器加载自定义错误 URL,而不是显示通用消息。我发现自己在这里问了两个问题:
- 据我所知,这是 Android 独有的功能。那么iOS是否有等效的方法? Phonegap iOS documentation没有就这个问题说任何话。
- 其次,错误 URL 是否可以指向构建应用程序的 project/www 文件夹中的单独 HTML 文档,还是必须是外部 URL。我的想法是,外部 URL 实际上没有多大意义 - 如果用户不在网络上时发生应用程序错误怎么办?
我非常感谢任何能够阐明这些问题的人。
最佳答案
来自 OP
From what I can tell this is an Android-only feature. So is there an equivalent method for iOS? The Phonegap iOS documentation does not say anything on the subject.
似乎有 no equivalent for iOS在文档中。您可以放心地假设,如果它不存在,则它不可用。
需要说明的是,底层 iOS 库没有默认的错误方法。在 Android 上,有一种方法可以处理这个问题。
Secondly, can the error URL point to a separate HTML document in the project/www folder from which the application will be built or does it have to be an external URL. My thinking is that an external URL does not in fact make much sense - what if the application error happens when the user is not on a network?
你的假设是正确的。 “error.html”应该位于设备上的 www/
目录中。该文件应该不在网络/互联网上。您会惊讶于我多次看到此错误。
关于android - Phonegap ErrorURL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33277026/