__CAPGO_KEEP_0__ - __CAPGO_KEEP_1__ App 的实时更新

开始

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';

API 简介

API 简介

loadWithKeys

loadWithKeys

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

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

registerIdentifiedUser

注册已知用户

复制到剪贴板

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

registerUnidentifiedUser

复制到剪贴板

更新用户

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

在 Intercom 中更新用户属性。

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

在 Intercom 中登出用户。

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

在 Intercom 中记录自定义事件。

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

在 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

隐藏消息者

复制到剪贴板

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

显示在应用内消息

从 Intercom 启用应用内消息。

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

hideInAppMessages

隐藏在应用内消息

从 Intercom 禁用应用内消息。

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

复制到剪贴板

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

displayArticle

复制到剪贴板

显示特定 Intercom 文章。

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

显示特定 Intercom 调查。

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

设置身份验证的 HMAC。

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

设置安全消息者认证的 JWT。

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

设置 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);

getUnreadConversationCount

标题:“获取未读会话数量”

获取当前用户的未读会话数量。

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

类型参考

类型参考

IntercomLoadOptions

IntercomLoadOptions
export interface IntercomLoadOptions {
appId?: string;
apiKeyIOS?: string;
apiKeyAndroid?: string;
}

IntercomIdentifiedUserOptions

IntercomIdentifiedUserOptions
export interface IntercomIdentifiedUserOptions {
userId?: string;
email?: string;
}

IntercomUserUpdateOptions

IntercomUserUpdateOptions
export interface IntercomUserUpdateOptions {
userId?: string;
email?: string;
name?: string;
phone?: string;
languageOverride?: string;
customAttributes?: { [key: string]: any };
companies?: IntercomCompany[];
}

IntercomLogEventOptions

IntercomLogEventOptions
export interface IntercomLogEventOptions {
name: string;
data?: { [key: string]: any };
}

IntercomMessageComposerOptions

IntercomMessageComposerOptions
export interface IntercomMessageComposerOptions {
message: string;
}

IntercomCarouselOptions

IntercomCarouselOptions
export interface IntercomCarouselOptions {
carouselId: string;
}

IntercomArticleOptions

《IntercomArticleOptions》
export interface IntercomArticleOptions {
articleId: string;
}

IntercomSurveyOptions

《IntercomSurveyOptions》
export interface IntercomSurveyOptions {
surveyId: string;
}

IntercomUserHashOptions

《IntercomUserHashOptions》
export interface IntercomUserHashOptions {
hmac: string;
}

IntercomUserJwtOptions

《IntercomUserJwtOptions》
export interface IntercomUserJwtOptions {
jwt: string;
}

IntercomBottomPaddingOptions

《IntercomBottomPaddingOptions》
export interface IntercomBottomPaddingOptions {
value: number;
}

IntercomPushTokenOptions

《IntercomPushTokenOptions》
export interface IntercomPushTokenOptions {
value: string;
}

真实数据来源

《真实数据来源》

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

继续从开始

《继续从开始》

如果您正在使用 开始 来规划仪表板和API操作,请将其连接到 使用@capgo/capacitor-intercom 用于在使用@capgo/capacitor-intercom中访问本地能力 API 介绍 for the implementation detail in API 介绍, 介绍 for the implementation detail in 介绍, API 密钥 for the implementation detail in API 密钥, and 设备 for the implementation detail in 设备.