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

Intercom

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

指南

Intercom使用教程

使用@capgo/capacitor-intercom

Capacitor Intercom插件.

安装

bun add @capgo/capacitor-intercom
bunx cap sync

此插件暴露的内容

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

示例使用方法

loadWithKeys

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

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

await CapgoIntercom.loadWithKeys({} as IntercomLoadOptions);

registerIdentifiedUser

使用 Intercom 注册已知用户。 至少需要提供一个 userId 或 email。

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 中的实现细节, 添加或更新插件 为添加或更新插件的实现细节。