跳过主要内容
返回插件
@capgo/capacitor-intercom
教程
@capgo/capacitor-intercom

Intercom

将Intercom的实时聊天、帮助中心和支持工作流程集成到您的Capacitor应用中

指南

Intercom 的教程

使用 @capgo/capacitor-intercom

Intercom Capacitor 插件

安装

bun add @capgo/capacitor-intercom
bunx cap sync

此插件暴露了什么

  • loadWithKeys - 在运行时使用 API 密钥初始化 Intercom。 如果您不想在 capacitor.config 中配置密钥,请使用此选项。
  • registerIdentifiedUser - 使用 userId 或 email 中至少一个注册已知用户与 Intercom。
  • registerUnidentifiedUser - 使用 Intercom 注册匿名用户。
  • updateUser - 在 Intercom 中更新用户属性。

- 示例用法

loadWithKeys

- 在运行时使用 API 密钥初始化 Intercom。 如果您不想在 capacitor.config 中配置密钥,请使用此选项。

import { CapgoIntercom } from '@capgo/capacitor-intercom';

await CapgoIntercom.loadWithKeys({} as IntercomLoadOptions);

registerIdentifiedUser

- 使用 userId 或 email 中至少一个注册已知用户与 Intercom。

import { CapgoIntercom } from '@capgo/capacitor-intercom';

await CapgoIntercom.registerIdentifiedUser({} as IntercomIdentifiedUserOptions);

registerUnidentifiedUser

- 使用 Intercom 注册匿名用户。

import { CapgoIntercom } from '@capgo/capacitor-intercom';

await CapgoIntercom.registerUnidentifiedUser();

updateUser

- 在 Intercom 中更新用户属性。

import { CapgoIntercom } from '@capgo/capacitor-intercom';

await CapgoIntercom.updateUser({} as IntercomUserUpdateOptions);

- 全部参考

继续使用 @capgo/capacitor-intercom

如果您正在使用 使用 @capgo/capacitor-intercom 来规划原生插件的工作,连接它与 @capgo/capacitor-intercom 查看 @capgo/capacitor-intercom 的实现细节 开始 查看开始的实现细节 Capgo 插件目录 查看 Capgo 插件目录中的产品工作流程 Capacitor 由 Capgo 提供的插件 为 Capacitor 的实现细节在 Capgo 插件中, 添加或更新插件 为 __CAPGO_KEEP_0__ 的实现细节在添加或更新插件中。