Zum Inhalt springen

Getting Started

GitHub

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:

Terminal-Fenster
npx skills add https://github.com/Cap-go/capgo-skills --skill capacitor-plugins

Verwenden 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:

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

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',
});

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',
});

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' });

Öffnen Sie den Intercom-Messenger.

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

Öffnen Sie den Nachrichtenkomponisten mit einer vorab eingegebenen Nachricht.

import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.displayMessageComposer({ message: 'Hello from Capacitor' });

Öffnen Sie das Intercom-Hilfesystem.

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

Verbergen Sie den Intercom-Messenger.

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

Zeige den Intercom-Launcher-Button.

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

Verstecke den Intercom-Launcher-Button.

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

Aktiviere in-app-Meldungen von Intercom.

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

Deaktiviere in-app-Meldungen 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({ carouselId: 'carousel-id-123' });

Ein bestimmtes Intercom-Artikel anzeigen.

import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.displayArticle({ articleId: 'article-id-123' });

Ein bestimmtes Intercom-Umfrage anzeigen.

import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.displaySurvey({ surveyId: 'survey-id-123' });

Die HMAC für die Identitätsprüfung setzen.

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

Sichere Nachrichtenauthentifizierung mit JWT einstellen.

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

Legen Sie die untere Padding-Einstellung für die Intercom-Messenger-UI fest.

import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.setBottomPadding({ value: 1 });

Senden Sie ein Push-Notification-Token an Intercom.

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

Ein empfangenes Intercom-Push-Notification verarbeiten.

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

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);
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 wurde aus dem Plugin generiert. src/definitions.tsRe-run die Synchronisation, wenn die öffentliche API upstream geändert wird.

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.