指南
如何在 Capacitor 中使用 Contentsquare
使用 @capgo/capacitor-contentsquare
内部本机桥接合同由 Capacitor 实现。
安装
bun add @capgo/capacitor-contentsquare
bunx cap sync
bunx cap sync 将插件的本机 code 复制到您的本机项目中。每次升级插件后,请再次运行它。
导入
import { Contentsquare } from '@capgo/capacitor-contentsquare';
API概览
| 方法 | 描述 |
|---|---|
optIn |
查看源定义以了解当前行为 |
optOut |
查看源定义以了解当前行为 |
sendScreenName |
查看源定义以了解当前行为 |
sendTransaction |
查看源定义以了解当前行为 |
sendDynamicVarWithStringValue |
查看源定义以了解当前行为 |
sendDynamicVarWithIntValue |
查看源定义以了解当前行为 |
onReady |
查看源定义以了解当前行为 |
excludeURLForReplay |
查看源定义以了解当前行为 |
setPIISelectors |
查看当前行为的源定义。 |
setCapturedElementsSelector |
查看当前行为的源定义。 |
collect |
查看当前行为的源定义。 |
示例
optIn()
查看API参考以了解当前协议。
import { Contentsquare } from '@capgo/capacitor-contentsquare';
await Contentsquare.optIn();
optOut()
查看API参考以了解当前协议。
import { Contentsquare } from '@capgo/capacitor-contentsquare';
await Contentsquare.optOut();
sendScreenName()
查看API参考以了解当前协议。
import { Contentsquare } from '@capgo/capacitor-contentsquare';
await Contentsquare.sendScreenName({ name: 'example' });
sendTransaction()
查看API参考以了解当前协议。
import { Contentsquare, CurrencyCode } from '@capgo/capacitor-contentsquare';
await Contentsquare.sendTransaction({
transactionValue: 1,
transactionCurrency: CurrencyCode.USD,
});
sendDynamicVarWithStringValue()
查看API参考以了解当前协议。
import { Contentsquare } from '@capgo/capacitor-contentsquare';
await Contentsquare.sendDynamicVarWithStringValue({
dynVarKey: 'dyn-var-key-123',
dynVarValue: 'dyn-var-value',
});
sendDynamicVarWithIntValue()
查看API参考以了解当前协议。
import { Contentsquare } from '@capgo/capacitor-contentsquare';
await Contentsquare.sendDynamicVarWithIntValue({
dynVarKey: 'dyn-var-key-123',
dynVarValue: 'dyn-var-value',
});
上表列出了11个核心方法。监听器和版本辅助函数,以及每个方法的完整协议,均在__CAPGO_KEEP_0__仓库中文档化。 GitHub 仓库.
全参考
继续使用 @capgo/capacitor-contentsquare
如果您正在使用 使用 @capgo/capacitor-contentsquare 为原生插件工作做计划,连接它与 @capgo/capacitor-contentsquare 在 @capgo/capacitor-contentsquare 中了解实现细节 开始 在开始中了解实现细节 Capgo 插件目录 为产品工作流程在 Capgo 插件目录中 Capacitor 插件由 Capgo 为实现细节在 Capacitor 插件由 Capgo 中 添加或更新插件 为实现细节在添加或更新插件中