跳过内容

Getting Started

GitHub

您可以使用我们的AI辅助设置来安装插件。使用以下命令将Capgo技能添加到您的AI工具中:

终端窗口
npx skills add https://github.com/Cap-go/capgo-skills --skill capacitor-plugins

然后使用以下提示:

Use the `capacitor-plugins` skill from `Cap-go/capgo-skills` to install the `@capgo/capacitor-intercom` plugin in my project.

如果您更喜欢手动设置,请通过运行以下命令安装插件并按照以下平台特定的说明进行操作:

终端窗口
bun add @capgo/capacitor-intercom
bunx cap sync
import { CapgoIntercom } from '@capgo/capacitor-intercom';

loadWithKeys

loadWithKeys

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

import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.loadWithKeys({} as IntercomLoadOptions);

registerIdentifiedUser

注册已知用户

至少需要提供一个用户ID或电子邮件。

import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.registerIdentifiedUser({} as IntercomIdentifiedUserOptions);

registerUnidentifiedUser

注册匿名用户

复制到剪贴板

import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.registerUnidentifiedUser();

loadWithKeys

import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.updateUser({} as IntercomUserUpdateOptions);

logout

登出

在 Intercom 中登出用户。

import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.logout();

logEvent

事件

在 Intercom 中记录一个自定义事件。

import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.logEvent({} as IntercomLogEventOptions);

displayMessenger

显示

打开 Intercom 消息中心。

import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.displayMessenger();

displayMessageComposer

显示

打开带有预填写消息的消息编辑器。

import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.displayMessageComposer({} as IntercomMessageComposerOptions);

displayHelpCenter

显示帮助中心

打开Intercom帮助中心

import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.displayHelpCenter();

hideMessenger

隐藏消息中心

隐藏Intercom消息中心

import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.hideMessenger();

displayLauncher

显示启动器

显示Intercom启动器按钮

import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.displayLauncher();

hideLauncher

隐藏启动器

隐藏Intercom启动器

import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.hideLauncher();

displayInAppMessages

displayInAppMessages

在应用内显示Intercom消息

import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.displayInAppMessages();

hideInAppMessages

hideInAppMessages

在应用内隐藏Intercom消息

import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.hideInAppMessages();

displayCarousel

displayCarousel

显示特定的Intercom旋转门

import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.displayCarousel({} as IntercomCarouselOptions);

displayArticle

displayArticle

显示特定的Intercom文章

import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.displayArticle({} as IntercomArticleOptions);

displaySurvey

displaySurvey

显示特定Intercom调查

import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.displaySurvey({} as IntercomSurveyOptions);

setUserHash

setUserHash

设置身份验证的HMAC

import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.setUserHash({} as IntercomUserHashOptions);

setUserJwt

setUserJwt

设置安全消息者认证的JWT

import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.setUserJwt({} as IntercomUserJwtOptions);

setBottomPadding

setBottomPadding

设置Intercom消息者UI的底部填充

import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.setBottomPadding({} as IntercomBottomPaddingOptions);

将推送令牌发送到Intercom。

import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.sendPushTokenToIntercom({} as IntercomPushTokenOptions);

处理接收到的Intercom推送通知。

import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.receivePush({} as IntercomPushNotificationData);

获取当前用户未读对话数。

import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.getUnreadConversationCount();
export interface IntercomLoadOptions {
appId?: string;
apiKeyIOS?: string;
apiKeyAndroid?: string;
}

IntercomIdentifiedUserOptions

标题:已识别用户选项
export interface IntercomIdentifiedUserOptions {
userId?: string;
email?: string;
}

IntercomUserUpdateOptions

标题:用户更新选项
export interface IntercomUserUpdateOptions {
userId?: string;
email?: string;
name?: string;
phone?: string;
languageOverride?: string;
customAttributes?: { [key: string]: any };
companies?: IntercomCompany[];
}

IntercomLogEventOptions

标题:日志事件选项
export interface IntercomLogEventOptions {
name: string;
data?: { [key: string]: any };
}

IntercomMessageComposerOptions

标题:消息组合器选项
export interface IntercomMessageComposerOptions {
message: string;
}

IntercomCarouselOptions

标题:轮播选项
export interface IntercomCarouselOptions {
carouselId: string;
}

IntercomArticleOptions

标题:文章选项
export interface IntercomArticleOptions {
articleId: string;
}
export interface IntercomSurveyOptions {
surveyId: string;
}
export interface IntercomUserHashOptions {
hmac: string;
}
export interface IntercomUserJwtOptions {
jwt: string;
}

IntercomBottomPaddingOptions

“IntercomBottomPaddingOptions”标题
export interface IntercomBottomPaddingOptions {
value: number;
}

IntercomPushTokenOptions

“IntercomPushTokenOptions”标题
export interface IntercomPushTokenOptions {
value: string;
}

真实数据来源

数据源

该页面是由插件生成的 src/definitions.ts.当公共 API 上游发生变化时,请重新运行同步。

从 Getting Started 开始

从 Getting Started 开始

如果您正在使用 Getting Started 来规划仪表板和 API 操作,连接它到 使用 @capgo/capacitor-intercom 在使用 @capgo/capacitor-intercom 中的原生能力 API 概述 在 API 概述 中的实现细节 简介 简介中的实现细节 API 键 API 键中的实现细节 设备 设备中的实现细节