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.
安装
安装bun add @capgo/capacitor-intercombunx cap sync导入
导入import { CapgoIntercom } from '@capgo/capacitor-intercom';loadWithKeys
使用密钥加载Initialize Intercom with API keys at runtime. Use this if you prefer not to configure keys in capacitor.config.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.loadWithKeys({} as IntercomLoadOptions);registerIdentifiedUser
标题:注册已识别用户使用 Intercom 注册已知用户。 至少需要提供一个用户 ID 或电子邮件。
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
标题:注销在 Intercom 中注销用户。
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.logout();logEvent
标题:logEvent在Intercom中记录自定义事件。
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.logEvent({} as IntercomLogEventOptions);displayMessenger
标题:displayMessenger打开Intercom的消息盒子。
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.displayMessenger();displayMessageComposer
标题:displayMessageComposer打开带有预填写消息的消息编辑器。
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.displayMessageComposer({} as IntercomMessageComposerOptions);displayHelpCenter
标题:displayHelpCenter打开Intercom的帮助中心。
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.displayHelpCenter();hideMessenger
标题:隐藏Messenger隐藏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
标题:隐藏应用内消息在 Intercom 中禁用应用内消息。
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.hideInAppMessages();displayCarousel
标题:显示旋转门在 Intercom 中显示特定的旋转门。
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.displayCarousel({} as IntercomCarouselOptions);displayArticle
标题:显示文章在 Intercom 中显示特定的文章。
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.displayArticle({} as IntercomArticleOptions);displaySurvey
标题:显示调查在 Intercom 中显示特定的调查。
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.displaySurvey({} as IntercomSurveyOptions);setUserHash
标题:设置用户哈希设置身份验证的HMAC哈希值
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.setUserHash({} as IntercomUserHashOptions);setUserJwt
标题:设置用户JWT设置安全的消息者认证JWT
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.setUserJwt({} as IntercomUserJwtOptions);setBottomPadding
标题:设置Intercom消息者UI底部间距设置Intercom消息者UI的底部间距
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.setBottomPadding({} as IntercomBottomPaddingOptions);sendPushTokenToIntercom
标题:发送推送令牌到Intercom将推送令牌发送到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
标题:IntercomIdentifiedUserOptionsexport 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 为 Using @capgo/capacitor-intercom 中的原生功能 API Overview 为 API Overview 中的实现细节 介绍 为 Introduction 中的实现细节 API 键 用于API 键的实现细节, 设备 用于设备的实现细节,