@capacitor-community/native-market

中文文档
8.0.0发布于 2025/12/26MITTypeScriptESM + CJS零依赖近 30 天下载 4.6万

A native market plugin for linking to google play or app store.

原始使用文档
文档目录10 节
  1. Plugin versions
  2. Install
  3. Configuration
  4. Supported methods
  5. Example
  6. openStoreListing(...)
  7. openDevPage(...)
  8. openCollection(...)
  9. openEditorChoicePage(...)
  10. search(...)

Capacitor Native Market Plugin

Capacitor community plugin for native market for Play Store/App Store.

Note: The plugin doesn't work on iOS Simulator because it doesn't have App Store app installed. It works on Android Virtual Devices if they have Google Play installed with a user logged in.

Maintenance Status: Actively Maintained

Plugin versions

Capacitor versionPlugin version
8.x8.x
7.x7.x
6.x6.x
5.x5.x
4.x4.x
< 3.x0.1.x

Install

npm install @capacitor-community/native-market
npx cap sync

Configuration

No configuration required for this plugin

Supported methods

NameAndroidiOSWeb
openStoreListing✅✅❌
openDevPage✅❌❌
openCollection✅❌❌
openEditorChoicePage✅❌❌
search✅✅❌

Example

import { NativeMarket } from "@capacitor-community/native-market";
import { Capacitor } from "@capacitor/core";

/**
 * This method will launch link in Play/App Store.
 * @param appId - ID of your application.
 * Eg:
 * io.ionic.ioniconf on Android
 * id1622127552 on iOS
 * @returns void
 */
let appId = "id1622127552";
if (Capacitor.getPlatform() === "android") {
  appId = "io.ionic.ioniconf";
}
NativeMarket.openStoreListing({
  appId: appId,
});

/**
 * This method will deep-link directly to an Play/App store listing page.
 * @param devId - ID of developer. Eg. com.example.app
 * @returns void
 */
NativeMarket.openDevPage({
  devId: "5700313618786177705",
});

/**
 * This method will link users to a collection or top charts.
 * @param name - name of the collection. Click [here](https://developer.android.com/distribute/marketing-tools/linking-to-google-play#OpeningCollection) for android options.
 * @returns void
 */
NativeMarket.openCollection({
  name: "featured",
});

/**
 * This method will link users to Editor's choice page.
 * @param editorChoice - ID of your application. Eg. editorial_fitness_apps_us
 * @returns void
 */
NativeMarket.openEditorChoicePage({
  editorChoice: "editorial_fitness_apps_us",
});

/**
 * This method will link users to custom search query.
 * @param editorChoice - terms to be searched in Play/App store.
 * @returns void
 */
NativeMarket.search({
  terms: "capacitor",
});

openStoreListing(...)

openStoreListing(options: { appId: string; }) => Promise<void>
ParamType
options{ appId: string; }

openDevPage(...)

openDevPage(options: { devId: string; }) => Promise<void>
ParamType
options{ devId: string; }

openCollection(...)

openCollection(options: { name: string; }) => Promise<void>
ParamType
options{ name: string; }

openEditorChoicePage(...)

openEditorChoicePage(options: { editorChoice: string; }) => Promise<void>
ParamType
options{ editorChoice: string; }

search(options: { terms: string; }) => Promise<void>
ParamType
options{ terms: string; }

版本与发布记录

@capacitor-community/native-market 共发布 11 个版本,首次发布于 2020/06/24;过去 12 个月发布了 1 个版本。

版本发布日期距今
8.0.0latest2025/12/2610 个月前
7.0.12025/03/171.6 年前
7.0.02025/01/251.8 年前
6.0.02024/04/222 年前
5.0.02023/06/093 年前
4.0.02023/06/093 年前

关于 @capacitor-community/native-market 的常见问题

@capacitor-community/native-market 是什么?

A native market plugin for linking to google play or app store.

如何安装 @capacitor-community/native-market?

在项目目录运行 npm install @capacitor-community/native-market,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:@capacitor/core(>=8.0.0)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@capacitor-community/native-market 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@capacitor-community/native-market 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@capacitor-community/native-market 可以商用吗?

@capacitor-community/native-market 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@capacitor-community/native-market 的下载量有多少?

根据 npm 官方下载统计,@capacitor-community/native-market 在 2026/10/09 – 2026/11/07 这 30 天内被下载 46,097 次,日均约 1,537 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@capacitor-community/native-market 还在维护吗?

最新版本 8.0.0 发布于 2025/12/26(10 个月前);至今共发布 11 个版本,其中过去 12 个月发布了 1 个;首次发布于 2020/06/24。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。