WebViewGold 文档 · iOS
🇨🇳 中文
获取 WebViewGold

重置应用 API

通过单个链接或 JavaScript 调用重置您的 iOS WebView 应用的缓存、Cookie 和本地存储。

In certain cases, resetting the app to its initial settings (by clearing cookies and cache) can be necessary to restore optimal performance. The Reset App API provides a straightforward way to initiate this reset.

Usage:

To reset the app data, simply use the following link within your app:

<a href="reset://">Reset App Link</a>
                  

This link will:

  • Clear all cookies
  • Clear cached data

Testing the Reset Functionality:

To test this feature, add the following demo URL to your WebViewGold app: https://www.onlineappcreator.com/reset_test.html

Note: Use the reset functionality sensibly, as it will clear user data related to cookies and cache, which could impact saved settings or session data, including logging users out of active sessions.

SDK 风格的实现说明

将此功能视为向 Web 层公开的原生能力:将生产网站或 PWA 作为唯一可信来源,然后使用文档中的 WebViewGold 配置标志、URL 命令和 JavaScript 桥接调用,仅在能够带来价值的地方启用原生 iOS 行为。这种方式让代码库易于维护,因为同一个 Web 应用只需极少的条件逻辑即可同时服务于浏览器、WebViewGold for iOS 以及其他 WebViewGold 平台。

为获得可靠的结果,建议优先使用 HTTPS 端点、稳定的路由名称、在界面中明确的成功/错误状态,以及封装原生调用的小型 JavaScript 辅助函数。例如,使用 jQuery Mobile、Lovable、Base44、Bolt、WordPress、Bubble、自定义 React/Vue/Angular 技术栈或静态 HTML 构建的 Web 应用,可以提供单个按钮或事件处理程序来触发原生 WebViewGold API,同时仍为浏览器提供优雅的回退方案。

  • 推荐的集成模式:检测应用上下文,调用 WebViewGold API,然后在原生回调或路由变更后更新 Web 界面。
  • 测试清单:在真机或打包构建上验证该功能,检查权限和商店审核文案,并确认仅使用浏览器的用户仍能获得有用的回退方案。
  • SEO 优势:让功能页面、路由标题和结构化内容在您的网站上保持可被索引,同时由 WebViewGold 为 iOS 用户提供原生应用外壳。

太忙了?我们替您搭建应用。

我们的团队为您配置、构建并提交 WebViewGold 应用——全程代劳、交付迅速、德国制造。

让我们搭建应用 →

在浏览器中构建

无需 Mac、无需 IDE:WebViewGold Cloud Builder 在线为您配置、构建并上传应用。

了解 Cloud Builder →