入门指南
复制一个包含安装步骤和本插件的完整 Markdown 指南的设置提示。
Set up this Capacitor plugin in the project.
Use the package manager already used by the project.
Install these package(s): `@capgo/capacitor-in-app-review`
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/in-app-review/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.
安装
安装bun add @capgo/capacitor-in-app-reviewbunx cap sync导入
导入部分import { CapgoInAppReview } from '@capgo/capacitor-in-app-review';API 介绍
部分:API 介绍requestReview
部分:requestReview向用户请求应用内评分。
此方法触发由平台提供的原生应用内评分对话框。 在 iOS 中,它使用 SKStoreReviewController。 在 Android 中,它使用 Play In-App Review API。
重要注意事项:
- 评分对话框可能不会每次调用此方法时都显示。 苹果和谷歌都有指导方针,限制了提示可以出现的频率。
- 用户可能不会看到评论提示。
- 方法成功解决,即使对话框未显示。
- 不要在用户操作的响应中调用此方法,如按钮点击。 相反,在应用程序的自然流程中调用它。
import { CapgoInAppReview } from '@capgo/capacitor-in-app-review';
// Request a review at an appropriate moment in your appawait CapgoInAppReview.requestReview();真实来源
标题为“真实来源”的部分此页面由插件生成的 src/definitions.ts. 当公共 API 上游更改时,请重新运行同步。