开始入门
复制一个带有安装步骤和完整 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
标题:注册已识别用户使用 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);logout
标题:注销__CAPGO_KEEP_0__
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.logout();logEvent
__CAPGO_KEEP_1__在 Intercom 中记录一个自定义事件
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.logEvent({} as IntercomLogEventOptions);displayMessenger
__CAPGO_KEEP_2__打开 Intercom 消息中心
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.displayMessenger();displayMessageComposer
__CAPGO_KEEP_3__打开带有预填写消息的消息编辑器
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.displayMessageComposer({} as IntercomMessageComposerOptions);displayHelpCenter
__CAPGO_KEEP_4__打开 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
标题:在应用内显示消息在应用内启用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
标题:sendPushTokenToIntercom将推送通知令牌发送到Intercom.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.sendPushTokenToIntercom({} as IntercomPushTokenOptions);receivePush
标题:接收推送处理已接收的Intercom推送通知.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.receivePush({} as IntercomPushNotificationData);getUnreadConversationCount
标题:获取未读会话数量获取当前用户的未读会话数量.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.getUnreadConversationCount();类型参考
标题:类型参考IntercomLoadOptions
标题:IntercomLoadOptionsexport 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 上游发生变化。
从 Getting Started 继续
标题为“从 Getting Started 继续”如果您正在使用 Getting Started 来规划仪表板和 API 操作,连接它到 使用 @capgo/capacitor-intercom 为本地能力在使用 @capgo/capacitor-intercom 中 API Overview 为 API Overview 实现细节 介绍 在介绍中关于实现细节的 API 键 在API 键中关于实现细节的, 和 设备 在设备中关于实现细节的。