Area di lavoro: Sito web di marketing Capgo. Ruolo: Testo di copertina del sito web. Visualizzato in: componente Hero.astro. Chiave del messaggio `hero_subtitle_v2` (Hero Subtitle V2).
Esegui una richiesta di configurazione con i passaggi di installazione e la guida markdown completa per questo plugin.
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.
Puoi utilizzare la nostra configurazione assistita dall'IA per installare il plugin. Aggiungi le Capgo competenze al tuo strumento di AI utilizzando il seguente comando:
npx skills add https://github.com/Cap-go/capgo-skills --skill capacitor-pluginsUsa poi il seguente prompt:
Use the `capacitor-plugins` skill from `Cap-go/capgo-skills` to install the `@capgo/capacitor-intercom` plugin in my project.Se preferisci l'installazione manuale, installa il plugin eseguendo i seguenti comandi e segui le istruzioni specifiche per la piattaforma riportate di seguito:
bun add @capgo/capacitor-intercombunx cap syncimport { CapgoIntercom } from '@capgo/capacitor-intercom';Sottosezione intitolata “API Overview”
Section titled “API Overview”loadWithKeys
Caricamento con chiaviInizializza Intercom con API chiavi in esecuzione in tempo reale. Usa questo se preferisci non configurare le chiavi in capacitor.config.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.loadWithKeys({ appId: 'app-id-123', apiKeyIOS: 'api-key-ios', apiKeyAndroid: 'api-key-android',});registerIdentifiedUser
Sezione intitolata “registerIdentifiedUser”Registra un utente noto con Intercom. È necessario fornire almeno uno dei valori userId o email.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.registerIdentifiedUser({ userId: 'user-id-123', email: 'user@example.com',});registerUnidentifiedUser
Sezione intitolata “registerUnidentifiedUser”Registra un utente anonimo con Intercom.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.registerUnidentifiedUser();updateUser
Sezione intitolata “updateUser”Aggiorna gli attributi dell'utente in Intercom.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.updateUser({ userId: 'user-id-123' });Esegui il logout dell'utente da Intercom.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.logout();logEvent
Sezione intitolata “logEvent”Inserisci un evento personalizzato in Intercom.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.logEvent({ name: 'example' });displayMessenger
Sezione intitolata “displayMessenger”Apri il messaggero di Intercom.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.displayMessenger();displayMessageComposer
Sezione intitolata “displayMessageComposer”Apri il compositore di messaggi con un messaggio precompilato.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.displayMessageComposer({ message: 'Hello from Capacitor' });displayHelpCenter
Sezione intitolata “displayHelpCenter”Apri il centro aiuto di Intercom.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.displayHelpCenter();hideMessenger
Sezione intitolata “nascondiMessaggero”Nascondi il messaggero di Intercom.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.hideMessenger();displayLauncher
Sezione intitolata “mostraAvvio”Mostra il pulsante di avvio di Intercom.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.displayLauncher();hideLauncher
Sezione intitolata “nascondiAvvio”Nascondi il pulsante di avvio di Intercom.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.hideLauncher();displayInAppMessages
Sezione intitolata “mostraMessaggiInApp”Abilita i messaggi in-app da parte di Intercom.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.displayInAppMessages();hideInAppMessages
Sezione intitolata “nascondiMessaggiNellaApp”Disabilita i messaggi in-app da Intercom.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.hideInAppMessages();displayCarousel
Sezione intitolata “mostraCarosello”Mostra un carosello specifico di Intercom.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.displayCarousel({ carouselId: 'carousel-id-123' });displayArticle
Sezione intitolata “mostraArticolo”Mostra un articolo specifico di Intercom.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.displayArticle({ articleId: 'article-id-123' });displaySurvey
Sezione intitolata “mostraSondaggio”Mostra un sondaggio specifico di Intercom.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.displaySurvey({ surveyId: 'survey-id-123' });setUserHash
Sottosezione intitolata “setUserHash”Imposta l'HMAC per la verifica dell'identità.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.setUserHash({ hmac: 'hmac' });setUserJwt
Sottosezione intitolata “setUserJwt”Imposta JWT per l'autenticazione sicura del messaggero.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.setUserJwt({ jwt: 'jwt' });setBottomPadding
Sottosezione intitolata “setBottomPadding”Imposta il padding inferiore per l'interfaccia utente del messaggero Intercom.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.setBottomPadding({ value: 1 });sendPushTokenToIntercom
Sottosezione intitolata “sendPushTokenToIntercom”Inviare un token di notifica push a Intercom.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.sendPushTokenToIntercom({ value: 'value' });receivePush
Sezione intitolata “riceviPush”Gestisci una notifica di push ricevuta da Intercom.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.receivePush({});getUnreadConversationCount
Sezione intitolata “getUnreadConversationCount”Ottieni il numero di conversazioni non lette per l'utente corrente.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
const result = await CapgoIntercom.getUnreadConversationCount();console.log(result);Riferimento di tipo
Sezione intitolata “Riferimento di tipo”IntercomLoadOptions
Sezione intitolata “IntercomLoadOptions”export interface IntercomLoadOptions { appId?: string; apiKeyIOS?: string; apiKeyAndroid?: string;}IntercomIdentifiedUserOptions
Sezione intitolata “IntercomIdentifiedUserOptions”export interface IntercomIdentifiedUserOptions { userId?: string; email?: string;}IntercomUserUpdateOptions
Opzioni di aggiornamento dell'utente Intercomexport interface IntercomUserUpdateOptions { userId?: string; email?: string; name?: string; phone?: string; languageOverride?: string; customAttributes?: { [key: string]: any }; companies?: IntercomCompany[];}IntercomLogEventOptions
Opzioni di evento di log Intercomexport interface IntercomLogEventOptions { name: string; data?: { [key: string]: any };}IntercomMessageComposerOptions
Opzione del Compositore di Messaggi Intercomexport interface IntercomMessageComposerOptions { message: string;}IntercomCarouselOptions
Sezione intitolata “Opzioni di carousel Intercom”export interface IntercomCarouselOptions { carouselId: string;}IntercomArticleOptions
Sezione intitolata “Opzioni di articolo Intercom”export interface IntercomArticleOptions { articleId: string;}IntercomSurveyOptions
Sezione intitolata “Opzioni di sondaggio Intercom”export interface IntercomSurveyOptions { surveyId: string;}IntercomUserHashOptions
Sezione intitolata “Opzioni hash utente Intercom”export interface IntercomUserHashOptions { hmac: string;}IntercomUserJwtOptions
Sezione intitolata “Opzioni JWT dell'utente Intercom”export interface IntercomUserJwtOptions { jwt: string;}IntercomBottomPaddingOptions
Opzioni di impostazione per IntercomBottomPaddingexport interface IntercomBottomPaddingOptions { value: number;}IntercomPushTokenOptions
Sezione intitolata “Opzioni token push Intercom”export interface IntercomPushTokenOptions { value: string;}Fonte di verità
Sezione intitolata “Fonte di verità”Questa pagina è generata dal plugin src/definitions.ts. Re-run the sync when the public API changes upstream.
Continua da Inizia a utilizzare
Sezione intitolata “Continua da Inizia a utilizzare”Se stai utilizzando Inizia a utilizzare per pianificare il dashboard e le operazioni API, collega il Utilizza @capgo/capacitor-intercom per la capacità nativa in Utilizza @capgo/capacitor-intercom, API Overview per i dettagli di implementazione in API Overview, Introduzione per i dettagli di implementazione in Introduzione, API Chiavi per i dettagli di implementazione in API Chiavi, e Dispositivi per i dettagli di implementazione nei dispositivi.