快速入门
复制包含安装步骤和该插件完整 Markdown 指南的配置 prompt。
Set up this Capacitor plugin in the project.
Use the package manager already used by the project.
Install these package(s): `@capgo/capacitor-android-inline-install`
Run the required Capacitor sync/update step after installation.
Read this markdown guide for the full setup steps: https://raw.githubusercontent.com/Cap-go/website/refs/heads/main/apps/docs/src/content/docs/docs/plugins/android-inline-install/getting-started.mdx
Use that guide for platform-specific steps, native file edits, permissions, config changes, imports, and usage setup.
If that guide references other docs pages, read them too.
安装
“安装”章节你可以使用我们的 AI 辅助设置来安装插件。使用以下命令将 Capgo skills 添加到你的 AI 工具中:
npx skills add https://github.com/Cap-go/capgo-skills --skill capacitor-plugins然后使用以下 prompt:
Use the `capacitor-plugins` skill from `Cap-go/capgo-skills` to install the `@capgo/capacitor-android-inline-install` plugin in my project.如果你更想手动设置,请运行以下命令安装插件,并按照下方各平台的说明操作:
npm install @capgo/capacitor-android-inline-installnpx cap sync导入
“导入”章节import { AndroidInlineInstall } from '@capgo/capacitor-android-inline-install';快速入门
章节标题为“快速入门”import { AndroidInlineInstall } from '@capgo/capacitor-android-inline-install';
await AndroidInlineInstall.startInlineInstall({ id: 'com.example.companion', overlay: true, fallback: true,});常见坑点
章节标题为“常见陷阱”- 仅限 Play 商店:通过 sideload 安装的 APK 无法内联安装。
- versionCode:必须高于已安装的 build 版本。
- 取消:处理取消操作,避免无限重试循环。
API 概览
章节标题:“API 概览”startInlineInstall
标题为 “startInlineInstall” 的章节使用 Google Play 覆盖层启动 inline install 流程。
注意:仅符合条件的应用可使用 Inline Install。参见: https://play.google.com/console/about/guides/premium-growth-tools/
import { AndroidInlineInstall } from '@capgo/capacitor-android-inline-install';
const result = await AndroidInlineInstall.startInlineInstall({ id: 'com.example.app', referrer: 'my-referrer', overlay: true, fallback: true});
if (result.started) { console.log('Install flow started'); if (result.fallbackUsed) { console.log('Using fallback Play Store link'); }}类型参考
“类型参考” 章节StartInlineInstallOptions
标题为 “StartInlineInstallOptions” 的章节启动内联安装流程的选项。
export interface StartInlineInstallOptions { /** Package name of the app to be installed (target app). */ id: string; /** Referrer string to pass to Play. Optional but recommended. */ referrer?: string; /** * Package name of your app (caller). Defaults to the current app package * if omitted. */ callerId?: string; /** Optional Custom Store Listing ID. */ csl_id?: string; /** Whether to request the Play overlay. Defaults to true. */ overlay?: boolean; /** If true, falls back to full Play Store deep link when overlay unavailable. Defaults to true. */ fallback?: boolean;}StartInlineInstallResult
标题为 “StartInlineInstallResult” 的章节启动内联安装流程的结果。
export interface StartInlineInstallResult { /** True when the inline install intent has been started. */ started: boolean; /** True if a fallback deep link was used instead of inline overlay. */ fallbackUsed?: boolean;}单一事实来源
标题为“单一事实来源”的部分本页面由插件的 src/definitions.ts生成。当上游的公共 API 发生变化时,请重新运行 sync。
从入门指南继续
“从入门指南继续”章节如果你正在使用 快速入门 要规划 dashboard 和 API 操作,请将其连接到 使用 @capgo/capacitor-android-inline-install 在“使用 @capgo/capacitor-android-inline-install”中的原生功能 API 概览 关于 API Overview 中的实现细节, 简介 关于 Introduction 中的实现细节, API 密钥 有关 API Keys 的实现细节,以及 设备 有关 Devices 的实现细节。