跳过主要内容
返回到插件
@capgo/capacitor-android-inline-install
教程
由 github.com/Cap-go

Android Inline Install

在应用程序内直接安装应用程序更新,而不离开Play商店

指南

Android内联安装教程

使用@capgo/capacitor-android-inline-install

用于触发Google Play内购流程的Android内联安装插件

安装

bun add @capgo/capacitor-android-inline-install
bunx cap sync

此插件暴露的内容

  • startInlineInstall - 使用Google Playoverlay启动内联安装流程

示例使用

startInlineInstall

使用Google Playoverlay启动内联安装流程

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');
  }
}

全参考