指南
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');
}
}
全参考
- GitHub: https://github.com/Cap-go/capacitor-android-inline-install/
- 文档:/docs/plugins/android-inline-install/