跳过内容

Using the capacitor updater with self-hosted capgo

GitHub

This tutorial will show how to use capacitor updater in a dev environment with self hosted capgo

  1. Cloned capgo

To use the capacitor updater with self-hosted capgo edit the capacitor.config.ts 从您的应用程序目录中复制并设置它,如下所示:

const config: CapacitorConfig = {
appId: 'com.demo.app',
appName: 'demoApp',
webDir: 'dist',
bundledWebRuntime: false,
plugins: {
CapacitorUpdater : {
statsUrl: "https://localhost:54321/functions/v1/stats",
channelUrl: "https://localhost:54321/functions/v1/channel_self",
updateUrl: "https://localhost:54321/functions/v1/updates"
},
},
};

这将使您能够在开发中使用本地capgo。然而,缺省情况下,这还不够。

缺省情况下,iOS、Android和Electron都需要使用HTTPS,需要使用Ngrock或localcan等工具来代理API以https方式

在Android中,有一种方法可以启用 文本通信 这可以通过修改 AndroidManifest.xml 并添加 android:usesCleartextTraffic="true" 在本地开发环境中 application 标签 本次更改的完整示例可以在这里看到 这里

如果您无法连接到 Android 应用,可能会出现问题。如果您无法在 Edge 函数中看到任何请求,请在终端中运行

终端窗口
adb reverse tcp:54321 tcp:54321

Keep going from Using the capacitor updater with self-hosted capgo

Section titled “Keep going from Using the capacitor updater with self-hosted capgo”

如果您正在使用 Using the capacitor updater with self-hosted capgo 来规划迁移和企业运营,连接它到 使用@capgo/capacitor-updater 为使用 @capgo/capacitor-updater 的本地能力 Capgo 企业版 为Capgo 企业版的产品流程 Ionic 企业版插件替代品 为Ionic 企业版插件替代品的产品流程 Capgo 替代品 为Capgo 替代品的产品流程,并且 Capgo 咨询 为Capgo 咨询的产品流程