设置您的网页应用或网站
为您的 iOS 应用准备网站、PWA 或本地 HTML 文件:使用远程 URL、将文件离线打包到应用中,或将两者结合并提供离线回退方案。
Option A) Use a URL for accessing your web application (= store files online)
Create a mobile-optimized website or web app and upload it to your webserver/webspace. WebViewGold for iOS is compatible with classic HTML, PHP, WordPress, Progressive Web Apps, HTML5 games, Wix, apprat.io, Bubble, jQuery Mobile, and modern AI/no-code builders such as Lovable, Base44, and Bolt. In a typical workflow, you build the product UI in jQuery, Lovable, Base44, Bolt, React, Vue, Angular, or your preferred stack, then use WebViewGold as the native iOS app shell that adds App Store packaging, push notifications, device APIs, URL handling, and other native capabilities.
For the best App Store review results, design your web experience to feel intentional on iPhone and iPad: responsive layouts, large tap targets, fast first paint, clear loading/empty/error states, and app-like navigation. By default, WebViewGold for iOS permits both HTTPS content and HTTP content. For a more production-grade security profile, restrict traffic to HTTPS by modifying the iOS transport security setting and consider the blockfaultyandselfsignedhttpscerts option. Please consider a professional User Experience/UX Review on UXreviewer.io or similar services to improve store approval readiness and long-term user retention.
Option B) Use a local HTML folder for accessing your web application (= store files within the app)
WebViewGold supports web apps based on local HTML folders, too: Set uselocalhtmlfolder to true (see next step) and copy your HTML/CSS/JavaScript files (including subdirectories) to the "local-www" folder in your Xcode project. To do this, make sure to:
- Delete the default files in the "local-www" folder by selecting them in the Xcode file hierarchy, then right-click to press "Delete", then press "Move to Trash".
- Select all the files for your local website, then drag and drop them into the Xcode file hierarchy under the "local-www" folder. Make sure "Create folder references" is checked and press "Finish".
Option C) Use an HTML folder if the user is offline, and use a remote URL if the user is online (= store files online + store backup/fallback files within the app)
Copy your HTML/CSS/JavaScript files (including subdirectories) to the "local-www" folder in your Xcode project. To do this, make sure to:
- Delete the default files in the "local-www" folder by selecting them in the Xcode file hierarchy, then right-click to press "Delete", then press "Move to Trash".
- Select all the files for your local website, then drag and drop them into the Xcode file hierarchy under the "local-www" folder. Make sure "Create folder references" is checked and press "Finish".
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 用户提供原生应用外壳。