跳至内容
WebViewGold 从 Vibe Coding 到 App Store
中文
获取 WebViewGold

Replit + 扫描器

您的 Replit 应用的原生二维码和条形码扫描

在 WebView 中基于浏览器的二维码扫描既慢又频繁索要权限。WebViewGold 通过一个链接(<code>qrcode://</code> 或 <code>barcodescanner://</code>)打开原生相机扫描器,并把结果直接交回您的 Replit 应用:URL 会自动打开,条形码值则存入一个 JavaScript 变量。

每个平台一次性 $109 起,或由我们的团队全程代劳,$698 起。

  • 审核通过保证 – 否则 14 天内退款
  • 无需编程
  • 一次性付费,免费更新
  • 7×24 小时人工支持
  • 2014 年起德国出品 · ISO 27001

您可以用它构建什么

二维码签到和门票

活动入场、课程考勤、健身房签到:二维码包含一个带令牌的 Replit 应用 URL,扫描器在应用内打开它,您的后端(Express/Flask/FastAPI 后端,搭配 Replit Postgres 或外部数据库)进行验证。

条形码查询

库存、产品目录、价格查询:扫描到的 EAN/UPC 值可通过 barcodescanresult 获取,可用于填充表单字段或触发查询。

会员与推荐

会员出示二维码,员工用同一个应用扫描。两端都只是 Replit 中的普通页面;相机部分是原生的。

给 Replit 的提示词

把这段粘贴到 Replit 中以实现 Web 应用端。检查结果,发布,然后在 WebViewGold 应用中测试。

粘贴到 Replit Agent 的提示词
Add native QR and barcode scanning to this Replit app for the WebViewGold wrapper. In the backend add GET /api/items/:code (lookup in Postgres) and POST /api/scans (code, scanned_by from the Replit Auth session, scanned_at). In the React app add a Scan page, visible only when navigator.userAgent contains my custom WebViewGold token, with Scan QR code (window.location.href = qrcode://) and Scan barcode (window.location.href = barcodescanner://). After the barcode call, poll the global barcodescanresult every 300 ms for up to 60 seconds, then call the lookup, record the scan and show the item. Add a route /i/:code for QR codes. Show a loading state instead of a timeout.

出色的工作!无需任何编码就能轻松完成。简单快捷!创作者也提供了大力帮助!

卢卡斯·杜波依斯(Lucas Dubois) · CodeCanyon

为 Replit 应用添加扫描器

约 10 分钟,外加您的业务逻辑。

  1. 添加扫描按钮

    一个导航到 qrcode://(二维码,结果 URL 在应用内打开)或 barcodescanner://(条形码,结果存入 barcodescanresult)的链接或按钮。通过检测 WebViewGold User-Agent,只在应用内显示它。

  2. 在您的 Web 应用中处理结果

    二维码:编码一个 Replit 应用的 URL(例如 https://app.yourdomain.com/checkin?token=…);应用会像普通导航一样打开它,剩下的由您的页面完成。条形码:扫描器关闭后读取 barcodescanresult,并在 Express/Flask/FastAPI 后端,搭配 Replit Postgres 或外部数据库 中调用您的查询。

  3. 说明相机权限

    WebViewGold 项目已经包含相机用途说明;请调整文本,使其说明您的用途(“用于在入口扫描门票”)。两个商店都会读取这些字符串。

  4. 选择扫描模式

    通过 scanningmode://on、off 或 auto,您可以控制扫描器是在第一次命中后关闭还是持续扫描,这对库存盘点很有用。

JavaScript 中的条形码结果

处理条形码变量的最简示例:

javascript
// button inside the app
function startScan() { window.location.href = "barcodescanner://"; }

// WebViewGold injects the result into the page
function onScannerClosed() {
  if (typeof barcodescanresult !== "undefined" && barcodescanresult) {
    document.querySelector("#sku").value = barcodescanresult;
    lookupProduct(barcodescanresult);
  }
}

常见问题

扫描器在商店里需要额外的权限吗?

只需要带用途说明的相机权限,WebViewGold 项目中已经包含。请在说明文字中如实描述用途;如果您存储扫描数据,还要在 App Privacy / 数据安全答案中如实说明。

我也能在浏览器中从 Web 应用扫描吗?

可以,使用 JavaScript 库。原生扫描器更快,并使用系统相机 UI;通过 User-Agent 检测应用,在应用内提供原生扫描器,在其他地方使用 Web 库。

支持哪些条形码格式?

通过原生平台的扫描框架支持常见的一维和二维格式(EAN、UPC、Code 128、QR 等)。

让您的应用上架商店的三种方式

结果相同,只是您需要投入的工作量不同。三种方式都附带审核通过保证和 7×24 小时人工支持。

自己动手

$109 每个平台,一次性付费

WebViewGold 许可证:一个现成的 Xcode 或 Android Studio 项目。粘贴您的 URL,设置名称和图标,开启所需功能,构建并提交。永久免费更新。

在主页查看方案

Cloud Builder

$349 每个许可证,一次性附加购买

无需 Mac、Xcode 或 Android Studio:在浏览器中完成配置,我们在云端构建两个应用,并将其交付到 App Store Connect 和 Play Console。

Cloud Builder 如何运作 试用免费演示

Full Service

$698 每个平台 $798

把您的 URL 和图标发给我们。我们的团队在 72 小时内完成配置、构建并交付您的应用,白标,附源码项目。两个平台共 $1,158。

Full Service 详情 服务提供方: WeSetupYourWebViewApp

冬季特惠价格有效期至 2026年12月31日。

准备好发布您的 Replit 应用了吗?

App Store & Google Play 审核通过保证 – 否则 14 天内退款

想直接交给我们?Full Service:我们在 72 小时内完成配置、构建并交付,每个平台 $698 起。有疑问?通过 7×24 小时在线聊天联系我们。

退款依据我们 FAQ 中列出的条件:应用因非内容原因被 Apple 和/或 Google 拒审,并在购买后 14 天内提出申请。