Zum Inhalt springen

Getting Started

Terminalfenster
bun add @capgo/capacitor-intercom
bunx cap sync
import { CapgoIntercom } from '@capgo/capacitor-intercom';

Initialisiere Intercom mit API Schlüsseln zur Laufzeit. Verwende dies, wenn du die Schlüssel in capacitor.config nicht konfigurieren möchtest.

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

Registriere einen bekannten Benutzer bei Intercom. Mindestens einer der Werte für userId oder email muss angegeben werden.

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

Registriere einen anonymen Benutzer bei Intercom.

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

Aktualisiere Benutzerattribute in Intercom.

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

Den Benutzer aus 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({} as IntercomLogEventOptions);

Den Intercom-Messenger öffnen.

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

Den Nachrichtenkomponisten mit einer vorab eingegebenen Nachricht öffnen.

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

Öffnen Sie das Intercom-Hilfzentrum.

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

Verbergen Sie das Intercom-Messenger.

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

Zeigen Sie den Intercom-Launcher-Button an.

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

Verbergen Sie den Intercom-Launcher-Button.

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

Aktivieren Sie die in-App-Nachrichten von Intercom.

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

Deaktivieren Sie die in-App-Nachrichten von Intercom.

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

Ein bestimmtes Intercom-Carousel anzeigen.

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

Ein bestimmtes Intercom-Artikel anzeigen.

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

Ein bestimmtes Intercom-Umfrage-Formular anzeigen.

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

Setzen Sie den HMAC für die Identitätsprüfung.

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

Setzen Sie JWT für sichere Messenger-Authentifizierung.

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

Setzen Sie die untere Abstandseinstellung für die Intercom-Messenger-Oberfläche.

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

Ein Push-Benachrichtigungs-Token an Intercom senden.

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

Ein von Intercom empfangenes Push-Benachrichtigung behandeln.

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

Die Anzahl der ungelesenen Gespräche für den aktuellen Benutzer ermitteln.

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

Abschnitt mit dem Titel „Typenverweis“

Abschnitt mit dem Titel „sendPushTokenToIntercom“
export interface IntercomLoadOptions {
appId?: string;
apiKeyIOS?: string;
apiKeyAndroid?: string;
}
export interface IntercomIdentifiedUserOptions {
userId?: string;
email?: string;
}
export interface IntercomUserUpdateOptions {
userId?: string;
email?: string;
name?: string;
phone?: string;
languageOverride?: string;
customAttributes?: { [key: string]: any };
companies?: IntercomCompany[];
}
export interface IntercomLogEventOptions {
name: string;
data?: { [key: string]: any };
}
export interface IntercomMessageComposerOptions {
message: string;
}
export interface IntercomCarouselOptions {
carouselId: string;
}
export interface IntercomArticleOptions {
articleId: string;
}
export interface IntercomSurveyOptions {
surveyId: string;
}
export interface IntercomUserHashOptions {
hmac: string;
}
export interface IntercomUserJwtOptions {
jwt: string;
}
export interface IntercomBottomPaddingOptions {
value: number;
}
export interface IntercomPushTokenOptions {
value: string;
}

Diese Seite wird aus dem Plugin generiert. src/definitions.tsRe-run die Synchronisation, wenn die öffentliche API upstream geändert wird.

Wenn Sie "Getting Started" verwenden, um das Dashboard und die __CAPGO_KEEP_0__-Operationen zu planen, verbinden Sie es mit Getting Started Um das Dashboard und die API-Operationen zu planen, verbinden Sie es mit Using @capgo/capacitor-intercom für die native Fähigkeit in Using @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 Seite bearbeiten