Getting Started
复制一个包含安装步骤和本插件的完整Markdown指南的设置命令。
Set up this Capacitor plugin in the project.
Use the package manager already used by the project.
Install these package(s): `@capgo/capacitor-intercom`
Run the required Capacitor sync/update step after installation.
Read this markdown guide for the full setup steps: https://raw.githubusercontent.com/Cap-go/website/refs/heads/main/apps/docs/src/content/docs/docs/plugins/intercom/getting-started.mdx
Use that guide for platform-specific steps, native file edits, permissions, config changes, imports, and usage setup.
If that guide references other docs pages, read them too.
您可以使用我们的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-intercombunx cap syncimport { 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
注册已知用户至少需要提供一个用户ID或电子邮件。
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.registerIdentifiedUser({} as IntercomIdentifiedUserOptions);registerUnidentifiedUser
注册匿名用户复制到剪贴板
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.registerUnidentifiedUser();updateUser
复制到剪贴板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);sendPushTokenToIntercom
Section titled “sendPushTokenToIntercom”将推送令牌发送到Intercom。
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.sendPushTokenToIntercom({} as IntercomPushTokenOptions);receivePush
Section titled “receivePush”处理接收到的Intercom推送通知。
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.receivePush({} as IntercomPushNotificationData);getUnreadConversationCount
Section titled “getUnreadConversationCount”获取当前用户未读对话数。
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.getUnreadConversationCount();IntercomLoadOptions
Section titled “IntercomLoadOptions”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;}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 上游发生变化时,请重新运行同步。
从 Getting Started 开始
从 Getting Started 开始如果您正在使用 Getting Started 来规划仪表板和 API 操作,连接它到 使用 @capgo/capacitor-intercom 在使用 @capgo/capacitor-intercom 中的原生能力 API 概述 在 API 概述 中的实现细节 简介 简介中的实现细节 API 键 API 键中的实现细节 设备 设备中的实现细节