Getting Started
Eine Setup-Vorlage mit den Installationsanweisungen und der vollständigen Markdown-Dokumentation für diesen Plugin kopieren.
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.
Installieren
Abschnitt mit dem Titel „Installieren“Sie können unsere AI-gestützte Einrichtung verwenden, um das Plugin zu installieren. Fügen Sie die Capgo Fähigkeiten Ihrem AI-Tool mit der folgenden Befehlszeile hinzu:
npx skills add https://github.com/Cap-go/capgo-skills --skill capacitor-pluginsVerwenden Sie dann die folgende Anfrage:
Use the `capacitor-plugins` skill from `Cap-go/capgo-skills` to install the `@capgo/capacitor-intercom` plugin in my project.Wenn Sie die manuelle Einrichtung bevorzugen, installieren Sie das Plugin, indem Sie die folgenden Befehle ausführen und die untenstehenden plattform-spezifischen Anweisungen befolgen:
bun add @capgo/capacitor-intercombunx cap syncImportieren
Abschnitt mit dem Titel „Importieren“import { CapgoIntercom } from '@capgo/capacitor-intercom';API Übersicht
Abschnitt mit dem Titel „API Übersicht“loadWithKeys
Abschnitt mit dem Titel „loadWithKeys“Initialisieren Sie Intercom mit API-Schlüsseln zur Laufzeit. Verwenden Sie diese Option, wenn Sie die Schlüssel in capacitor.config nicht konfigurieren möchten.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.loadWithKeys({ appId: 'app-id-123', apiKeyIOS: 'api-key-ios', apiKeyAndroid: 'api-key-android',});registerIdentifiedUser
Abschnitt mit dem Titel „registerIdentifiedUser“Registrieren Sie einen bekannten Benutzer bei Intercom. Zumindest einer der Werte für userId oder email muss angegeben werden.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.registerIdentifiedUser({ userId: 'user-id-123', email: 'user@example.com',});registerUnidentifiedUser
Abschnitt mit dem Titel „registerUnidentifiedUser“Ein anonymen Benutzer bei Intercom registrieren.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.registerUnidentifiedUser();Benutzerattribute in Intercom aktualisieren.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.updateUser({ userId: 'user-id-123' });Benutzer von Intercom abmelden.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.logout();Ein benutzerdefiniertes Ereignis in Intercom protokollieren.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.logEvent({ name: 'example' });displayMessenger
Abschnitt mit dem Titel “displayMessenger”Öffnen Sie den Intercom-Messenger.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.displayMessenger();displayMessageComposer
Abschnitt mit dem Titel “displayMessageComposer”Öffnen Sie den Nachrichtenkomponisten mit einer vorab eingegebenen Nachricht.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.displayMessageComposer({ message: 'Hello from Capacitor' });displayHelpCenter
Abschnitt mit dem Titel “displayHelpCenter”Öffnen Sie das Intercom-Hilfesystem.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.displayHelpCenter();hideMessenger
Abschnitt mit dem Titel “hideMessenger”Verbergen Sie den Intercom-Messenger.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.hideMessenger();displayLauncher
Abschnitt mit dem Titel “displayLauncher”Zeige den Intercom-Launcher-Button.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.displayLauncher();hideLauncher
Abschnitt mit dem Titel “hideLauncher”Verstecke den Intercom-Launcher-Button.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.hideLauncher();displayInAppMessages
Abschnitt mit dem Titel “displayInAppMessages”Aktiviere in-app-Meldungen von Intercom.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.displayInAppMessages();hideInAppMessages
Abschnitt mit dem Titel “hideInAppMessages”Deaktiviere in-app-Meldungen von Intercom.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.hideInAppMessages();displayCarousel
Abschnitt mit dem Titel “displayCarousel”Ein bestimmtes Intercom-Carousel anzeigen.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.displayCarousel({ carouselId: 'carousel-id-123' });displayArticle
Abschnitt mit dem Titel “displayArticle”Ein bestimmtes Intercom-Artikel anzeigen.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.displayArticle({ articleId: 'article-id-123' });displaySurvey
Abschnitt mit dem Titel “displaySurvey”Ein bestimmtes Intercom-Umfrage anzeigen.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.displaySurvey({ surveyId: 'survey-id-123' });setUserHash
Abschnitt mit dem Titel “setUserHash”Die HMAC für die Identitätsprüfung setzen.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.setUserHash({ hmac: 'hmac' });setUserJwt
Abschnitt mit dem Titel “setUserJwt”Sichere Nachrichtenauthentifizierung mit JWT einstellen.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.setUserJwt({ jwt: 'jwt' });setBottomPadding
Abschnitt mit dem Titel “setBottomPadding”Legen Sie die untere Padding-Einstellung für die Intercom-Messenger-UI fest.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.setBottomPadding({ value: 1 });sendPushTokenToIntercom
Abschnitt mit dem Titel “sendPushTokenToIntercom”Senden Sie ein Push-Notification-Token an Intercom.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.sendPushTokenToIntercom({ value: 'value' });receivePush
Abschnitt mit dem Titel “receivePush”Ein empfangenes Intercom-Push-Notification verarbeiten.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.receivePush({});getUnreadConversationCount
Abschnitt mit dem Titel “getUnreadConversationCount”Ermitteln Sie die Anzahl der ungelesenen Gespräche für den aktuellen Benutzer.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
const result = await CapgoIntercom.getUnreadConversationCount();console.log(result);Typenreferenz
Abschnitt mit dem Titel “Typenreferenz”IntercomLoadOptions
Abschnitt mit dem Titel “IntercomLoadOptions”export interface IntercomLoadOptions { appId?: string; apiKeyIOS?: string; apiKeyAndroid?: string;}IntercomIdentifiedUserOptions
Abschnitt mit dem Titel “IntercomIdentifiedUserOptions”export interface IntercomIdentifiedUserOptions { userId?: string; email?: string;}IntercomUserUpdateOptions
Abschnitt mit dem Titel “IntercomUserUpdateOptions”export interface IntercomUserUpdateOptions { userId?: string; email?: string; name?: string; phone?: string; languageOverride?: string; customAttributes?: { [key: string]: any }; companies?: IntercomCompany[];}IntercomLogEventOptions
Abschnitt mit dem Titel “IntercomLogEventOptions”export interface IntercomLogEventOptions { name: string; data?: { [key: string]: any };}IntercomMessageComposerOptions
Abschnitt mit dem Titel „IntercomMessageComposerOptions“export interface IntercomMessageComposerOptions { message: string;}IntercomCarouselOptions
Abschnitt mit dem Titel „IntercomCarouselOptions“export interface IntercomCarouselOptions { carouselId: string;}IntercomArticleOptions
Abschnitt mit dem Titel „IntercomArticleOptions“export interface IntercomArticleOptions { articleId: string;}IntercomSurveyOptions
Abschnitt mit dem Titel „IntercomSurveyOptions“export interface IntercomSurveyOptions { surveyId: string;}IntercomUserHashOptions
Abschnitt mit dem Titel „IntercomUserHashOptions“export interface IntercomUserHashOptions { hmac: string;}IntercomUserJwtOptions
Abschnitt mit dem Titel „IntercomUserJwtOptions“export interface IntercomUserJwtOptions { jwt: string;}IntercomBottomPaddingOptions
Abschnitt mit dem Titel „IntercomBottomPaddingOptions“export interface IntercomBottomPaddingOptions { value: number;}IntercomPushTokenOptions
Abschnitt mit dem Titel „IntercomPushTokenOptions“export interface IntercomPushTokenOptions { value: string;}Quelle der Wahrheit
Abschnitt mit dem Titel „Quelle der Wahrheit“Diese Seite wurde aus dem Plugin generiert. src/definitions.tsRe-run die Synchronisation, wenn die öffentliche API upstream geändert wird.
Weitermachen von Getting Started
Abschnitt mit dem Titel „Weitermachen von Getting Started“Wenn Sie Intercom verwenden Getting Started um das Dashboard und die API-Operationen zu planen, verbinden Sie es mit Mit @capgo/capacitor-intercom Für die native Fähigkeit in Mit @capgo/capacitor-intercom, API-Übersicht Für die Implementierungsdetails in API-Übersicht, Einführung Für die Implementierungsdetails in Einführung, API-Schlüssel Für die Implementierungsdetails in API-Schlüssel und Geräte Für die Implementierungsdetails in Geräte.