Project(项目)
技术栈、托管和命令。代理会用这些命令来验证自己的工作;记得写上运行测试的那条命令。
Claude Code
Claude Code 会在每次会话开始时读取 CLAUDE.md,因此这里正是说明“您的 Web 应用也运行在原生 iOS 和 Android 应用中”的最佳位置。有了这个文件,代理就不会再破坏安全区域,会让隐私页面始终如实,并能正确调用 WebViewGold 桥接,您也不必一遍遍重复。
每个平台一次性 $109 起,或由我们的团队全程代劳,$698 起。
没有上下文时,代理会针对它熟悉的浏览器做优化。它会加上 Cookie 墙,在定价页上放一个 Stripe 按钮,忘记固定页脚正压在 iPhone 的主屏幕指示条上,还会在重构时毫不犹豫地删掉“删除账户”路由。其中每一项都会招致商店拒审。CLAUDE.md 文件从源头上解决这个问题:它告诉 Claude Code 原生封装层是什么、有哪些 URL scheme、哪些商店规则不容商量,以及哪些路由必须始终可用。
复制模板,替换示例值,提交到仓库根目录。Claude Code 在该项目中会自动读取它,您团队中任何运行代理的人也一样。
替换技术栈、域名和路由列表。删除您用不到的桥接条目;这个文件应该描述您的应用,而不是罗列 WebViewGold 的所有功能。
# CLAUDE.md
## Project
- Next.js (App Router), TypeScript, Tailwind. Supabase for auth and Postgres. Stripe for web checkout.
- Deployed on Vercel at https://app.example.com. Every production deploy is live in the native apps immediately.
- Commands: npm run dev, npm run lint, npm run test, npm run build. Run lint and tests before reporting done.
## Native app context (read this first)
- This web app is also published as iOS and Android apps built with WebViewGold, a native WebView wrapper.
The apps load https://app.example.com in a WKWebView / Android WebView. There is no separate mobile codebase.
- The apps send a custom user agent that contains the token WebViewGoldApp.
Use isNativeApp() from src/lib/native.ts to branch. Never duplicate the user agent check.
- Native features are triggered by navigating to a URL scheme: window.location.href = "scheme://...".
Results come back as injected global JavaScript variables or as calls to global functions.
Full reference: https://www.webviewgold.com/llms-full.txt. Read the relevant section before adding a feature.
- Only call a scheme when isNativeApp() is true. In browsers use the web equivalent or hide the control.
- On iOS, several scheme calls in one script run must be combined: multiapicall://getonesignalplayerid,getappversion
## WebViewGold bridge used in this project
- Push permission: registerpush:// (shows the system prompt). Status: checkNativePushPermissions:// then read
window.nativePushEnabled after a short delay. System settings: settingsapp://
- Push user ID: getonesignalplayerid:// then read window.onesignalplayerid; store it on the user profile.
- Local notification: sendlocalpushmsg://push.send?s=SECONDS=msg!MESSAGE&!#TITLE&!#URL
Cancel all: sendlocalpushmsg://push.send.cancel
- Biometrics: bioauth:// then the wrapper calls window.onBioAuthSuccess(), window.onBioAuthFailure(code, message)
or window.onBioAuthUnavailable(). Treat success as a UI gate only; the server session stays the source of truth.
- Scanner: qrcode:// opens the native scanner and loads the scanned URL in the app.
barcodescanner:// then read window.barcodescanresult.
- Share sheet: shareapp://message?=TEXT&url=URL (URL-encode both values).
- Haptics: lighthaptic://, heavyhaptic://, successhaptic://, warninghaptic://, errorhaptic:// (mediumhaptic:// is iOS only).
- Downloads: savethisimage://?url=IMAGE_URL saves to the photo library; links ending in .pdf, .docx, .xlsx or .mp3
download natively.
- Purchases: revenuecat://purchase?external_id=USER_ID&product=PRODUCT_ID. Entitlements arrive through the
RevenueCat webhook at /api/webhooks/revenuecat and are stored in the subscriptions table.
- App version: getappversion:// then read window.versionNumber. Rating prompt: rateapp://
## Store rules (never break these)
- Apple 4.2: the app must do more than the website. Push, offline handling and the share sheet must keep working.
- Apple 4.8: a third-party login exists, so Sign in with Apple stays available and equally prominent.
- Apple 5.1.1 and Google Play: /privacy must describe real data practices; Delete account stays in settings and works.
- Apple 3.1.1 and Google Play billing: inside the native app, digital goods go through revenuecat://, never Stripe.
Never render external payment links or web prices when isNativeApp() is true.
- Apple 2.3: no beta labels, no coming-soon screens, no placeholder content in production.
- Apple 4.0: safe-area padding on fixed bars, 44 px tap targets, no horizontal overflow at 320 px width.
- Never add Download our app banners, builder badges or cookie walls.
## Conventions
- Mobile first. Verify every UI change at 320 px, 390 px and at iPad width.
- Every data fetch has loading, empty and error states with a retry action.
- Secrets stay server-side. The client bundle must never contain a service-role key or a webhook secret.
- Routes the native apps and store listings depend on: /, /login, /privacy, /terms, /delete-account, /settings.
Changing or removing one of them requires a note in docs/native-app.md.技术栈、托管和命令。代理会用这些命令来验证自己的工作;记得写上运行测试的那条命令。
最重要的一个部分。它说明存在一个 WebView、如何检测它、原生功能都是 URL scheme,以及文档在哪里。有了 llms-full.txt 链接,代理会自己查阅细节,而不是去猜。
只列出您实际用到的 scheme 及其返回变量。这样可以防止代理编造 API 名称,这是代理在使用任何桥接时最常犯的错误。
每一行都对应一个准则编号,这样代理就能在 diff 总结中解释自己的决定。列表要保持简短;规则一多,就会被一扫而过。
断点、状态处理、密钥和受保护的路由。正是受保护路由这一行,能让您免于在某次重构中悄无声息地丢掉 /delete-account。

把 Web 应用转换成原生应用的绝佳方式!周转速度快,无需开发完整的原生应用就能把应用上架到应用商店!
模板假定应用会标识自己。在 Config.swift 中设置 useragent_iphone 和 useragent_ipad,在 Config.java 中设置 USER_AGENT,各自设为一个普通的移动端 User-Agent 字符串,后面加一个空格和 WebViewGoldApp。如果留空,就会使用系统默认的 User-Agent,您的代码无法把它与 Safari 或 Chrome 区分开。
告诉 Claude Code:“按照 CLAUDE.md 中的描述创建 src/lib/native.ts,包含 isNativeApp(),以及一个仅在 isNativeApp() 为 true 时才设置 window.location.href 的 callNative(scheme) 函数。”其他一切都可以建立在这两个函数之上。
删除您没有在 WebViewGold 项目中启用的功能所对应的条目。如果某个 scheme 被列了出来,却没有在 Config.swift 中开启(例如没有配置推送服务的推送),它在运行时什么也不做,还会给调试添乱。
当您启用新的原生功能或修改受保护的路由时,在同一个 commit 中更新这个文件。只要您让 Claude Code“更新 CLAUDE.md 以反映这次改动”,它就会替您完成。
| 功能 | 调用 | 结果 |
|---|---|---|
| 推送权限 | registerpush:// | 系统弹窗;之后 checkNativePushPermissions:// 会设置 nativePushEnabled |
| 生物识别验证 | bioauth:// | 调用 onBioAuthSuccess()、onBioAuthFailure(code, message) 或 onBioAuthUnavailable() |
| 二维码扫描 | qrcode:// | 扫描到的 URL 在应用内加载 |
| 分享面板 | shareapp://message?=TEXT&url=URL | 原生分享对话框 |
| 购买 | revenuecat://purchase?external_id=…&product=… | 商店购买界面;权益通过 RevenueCat 同步 |
| 推送用户 ID | getonesignalplayerid:// | 设置 onesignalplayerid |
适用。Cursor 读取项目规则文件,Codex 读取 AGENTS.md。内容是一样的,只有文件名和位置不同。请参阅本栏目中的 Cursor 规则模板和 AGENTS.md 模板。
不应该。链接到 llms-full.txt,只列出您用到的 scheme。过于庞大的上下文文件会稀释真正重要的规则,而代理可以按需获取细节。
就放在模板里,在对应 scheme 旁加一条简短说明即可(例如 mediumhaptic:// 仅限 iOS)。差异较大时,添加一个 docs/native-app.md 文件,并在 CLAUDE.md 中引用它。
它可以根据代码库起草一份,但除非您告诉它,否则它并不知道原生封装层的存在。请从这个模板开始,再让代理补全技术栈和路由细节。
结果相同,只是您需要投入的工作量不同。三种方式都附带审核通过保证和 7×24 小时人工支持。
$109 每个平台,一次性付费
WebViewGold 许可证:一个现成的 Xcode 或 Android Studio 项目。粘贴您的 URL,设置名称和图标,开启所需功能,构建并提交。永久免费更新。
在主页查看方案$349 每个许可证,一次性附加购买
无需 Mac、Xcode 或 Android Studio:在浏览器中完成配置,我们在云端构建两个应用,并将其交付到 App Store Connect 和 Play Console。
Cloud Builder 如何运作 试用免费演示$698 每个平台 $798
把您的 URL 和图标发给我们。我们的团队在 72 小时内完成配置、构建并交付您的应用,白标,附源码项目。两个平台共 $1,158。
Full Service 详情 服务提供方:冬季特惠价格有效期至 2026年12月31日。
App Store & Google Play 审核通过保证 – 否则 14 天内退款
想直接交给我们?Full Service:我们在 72 小时内完成配置、构建并交付,每个平台 $698 起。有疑问?通过 7×24 小时在线聊天联系我们。
退款依据我们 FAQ 中列出的条件:应用因非内容原因被 Apple 和/或 Google 拒审,并在购买后 14 天内提出申请。