android - Phonegap ErrorURL

标签 android ios cordova

Phonegap documentation表示如果应用程序遇到错误,可以让应用程序的浏览器包装器加载自定义错误 URL,而不是显示通用消息。我发现自己在这里问了两个问题:

  1. 据我所知,这是 Android 独有的功能。那么iOS是否有等效的方法? Phonegap iOS documentation没有就这个问题说任何话。
  2. 其次,错误 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/

相关文章:

java - 使用socket连接PC的问题

java - 推送通知时出现致命异常

android - 将gradle插件更新到2.0.0时出现错误

objective-c - Objective-C : How to create border effect around photos

ios - 你如何本地化 UIAlertview 的内容

windows - 如何解决本地 Windows UWP (Cordova) 网络问题

android - 带 Assets 的 Cordova 插件

java - 方法必须从UI线程调用,当前推断的线程是worker

javascript - Onsen UI - 处理硬件后退按钮

ios - 将相机添加到用户在 map 上的当前位置