本地市场插件
Play Store/App Store的本土市场Capacitor社区插件.
说明: 该插件在iOS模拟器上不起作用,因为它没有安装App Store应用.
它在Android虚拟设备上工作,如果他们安装了Google Play的用户登录.
维持状况:积极维持
插件版本
| 电容版本 | 插件版本 |
| 8.x 电话 | 8.x 电话 |
| 7.x 电话 | 7.x 电话 |
| 6.x (单位:千美元) | 6.x (单位:千美元) |
| 5.x 电话 | 5.x 电话 |
| 4.x (中文(简体) ) | 4.x (中文(简体) ) |
| < 3.x 键 | 0.1.x (中文(简体) ) |
安装
npm install @capacitor-community/native-market
npx cap sync
配置
此插件不需要配置
支持的方法
| 名称 | 机器人 | iOS系统 | 网页 |
| 打开站点列表 | ✅ | ✅ | ❌ |
| 打开DevPage | ✅ | ❌ | ❌ |
| 打开收集 | ✅ | ❌ | ❌ |
| 打开编辑器选择页 | ✅ | ❌ | ❌ |
| 搜索 | ✅ | ✅ | ❌ |
示例
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",
});
打开StoreListing(...)
openStoreListing(options: { appId: string; }) => Promise<void>
| 参数 | 类型 |
options | { appId: string; } |
打开DevPage(...)
openDevPage(options: { devId: string; }) => Promise<void>
| 参数 | 类型 |
options | { devId: string; } |
打开集合(...)
openCollection(options: { name: string; }) => Promise<void>
| 参数 | 类型 |
options | { name: string; } |
打开编辑器选择页(...)
openEditorChoicePage(options: { editorChoice: string; }) => Promise<void>
| 参数 | 类型 |
options | { editorChoice: string; } |
搜索(...)
search(options: { terms: string; }) => Promise<void>
| 参数 | 类型 |
options | { terms: string; } |