Mulai
Salin prompt pengaturan dengan langkah instalasi dan panduan markdown lengkap untuk plugin ini.
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.
Instal
Judul bagian “Instal”bun add @capgo/capacitor-intercombunx cap syncImpor
Judul Bagian “Impor”import { CapgoIntercom } from '@capgo/capacitor-intercom';API Ringkasan
Judul Bagian “API Ringkasan”loadWithKeys
Judul Bagian “loadWithKeys”Inisialisasi Intercom dengan API kunci pada waktu eksekusi. Gunakan ini jika Anda lebih suka tidak mengonfigurasi kunci di capacitor.config.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.loadWithKeys({} as IntercomLoadOptions);registerIdentifiedUser
Judul Bagian “registerIdentifiedUser”Daftarkan pengguna yang dikenal dengan Intercom. Setidaknya salah satu userId atau email harus disediakan.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.registerIdentifiedUser({} as IntercomIdentifiedUserOptions);registerUnidentifiedUser
Judul Bagian “registerUnidentifiedUser”Daftarkan pengguna anonim dengan Intercom.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.registerUnidentifiedUser();updateUser
Bagian berjudul “updateUser”Perbarui atribut pengguna di Intercom.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.updateUser({} as IntercomUserUpdateOptions);logout
Bagian berjudul “logout”Keluar pengguna dari Intercom.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.logout();logEvent
Bagian berjudul “logEvent”Log kejadian kustom di Intercom.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.logEvent({} as IntercomLogEventOptions);displayMessenger
Bagian berjudul “displayMessenger”Buka pesan Intercom.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.displayMessenger();displayMessageComposer
Bagian berjudul “displayMessageComposer”Buka komposer pesan dengan pesan yang sudah diisi.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.displayMessageComposer({} as IntercomMessageComposerOptions);displayHelpCenter
Bagian berjudul “displayHelpCenter”Buka pusat bantuan Intercom.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.displayHelpCenter();hideMessenger
Bagian berjudul “hideMessenger”Tutup pesan Intercom.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.hideMessenger();displayLauncher
Bagian berjudul “displayLauncher”Tampilkan tombol peluncur Intercom.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.displayLauncher();hideLauncher
Bagian berjudul “hideLauncher”Tutup tombol peluncur Intercom.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.hideLauncher();displayInAppMessages
Bagian berjudul “displayInAppMessages”Aktifkan pesan dalam aplikasi dari Intercom.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.displayInAppMessages();hideInAppMessages
Bagian berjudul “hideInAppMessages”Nonaktifkan pesan dalam aplikasi dari Intercom.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.hideInAppMessages();displayCarousel
Bagian berjudul “displayCarousel”Tampilkan carousel Intercom tertentu.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.displayCarousel({} as IntercomCarouselOptions);displayArticle
Bagian berjudul “displayArticle”Tampilkan artikel Intercom tertentu.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.displayArticle({} as IntercomArticleOptions);displaySurvey
Bagian berjudul “displaySurvey”Tampilkan survei Intercom tertentu.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.displaySurvey({} as IntercomSurveyOptions);setUserHash
Bagian berjudul “setUserHash”Atur HMAC untuk verifikasi identitas.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.setUserHash({} as IntercomUserHashOptions);setUserJwt
Bagian berjudul “setUserJwt”Set JWT untuk autentikasi pesan messenger yang aman.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.setUserJwt({} as IntercomUserJwtOptions);setBottomPadding
Bagian berjudul “setBottomPadding”Atur jarak bawah untuk antarmuka UI messenger Intercom.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.setBottomPadding({} as IntercomBottomPaddingOptions);sendPushTokenToIntercom
Bagian berjudul “sendPushTokenToIntercom”Kirim token notifikasi push ke Intercom.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.sendPushTokenToIntercom({} as IntercomPushTokenOptions);receivePush
Bagian berjudul “receivePush”Tangani notifikasi push Intercom yang diterima.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.receivePush({} as IntercomPushNotificationData);getUnreadConversationCount
Bagian berjudul “getUnreadConversationCount”Dapatkan jumlah percakapan yang belum dibaca untuk pengguna saat ini.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.getUnreadConversationCount();Referensi Tipe
Bagian berjudul “Referensi Tipe”IntercomLoadOptions
Bagian berjudul “IntercomLoadOptions”export interface IntercomLoadOptions { appId?: string; apiKeyIOS?: string; apiKeyAndroid?: string;}IntercomIdentifiedUserOptions
Bagian berjudul “IntercomIdentifiedUserOptions”export interface IntercomIdentifiedUserOptions { userId?: string; email?: string;}IntercomUserUpdateOptions
Bagian berjudul “IntercomUserUpdateOptions”export interface IntercomUserUpdateOptions { userId?: string; email?: string; name?: string; phone?: string; languageOverride?: string; customAttributes?: { [key: string]: any }; companies?: IntercomCompany[];}IntercomLogEventOptions
Bagian berjudul “IntercomLogEventOptions”export interface IntercomLogEventOptions { name: string; data?: { [key: string]: any };}IntercomMessageComposerOptions
Bagian berjudul “IntercomMessageComposerOptions”export interface IntercomMessageComposerOptions { message: string;}IntercomCarouselOptions
Bagian berjudul “IntercomCarouselOptions”export interface IntercomCarouselOptions { carouselId: string;}IntercomArticleOptions
Bagian berjudul “IntercomArticleOptions”export interface IntercomArticleOptions { articleId: string;}IntercomSurveyOptions
Bagian berjudul “IntercomSurveyOptions”export interface IntercomSurveyOptions { surveyId: string;}IntercomUserHashOptions
Bagian berjudul “IntercomUserHashOptions”export interface IntercomUserHashOptions { hmac: string;}IntercomUserJwtOptions
Bagian berjudul “IntercomUserJwtOptions”export interface IntercomUserJwtOptions { jwt: string;}IntercomBottomPaddingOptions
Pilihan Jarak Bawah Intercomexport interface IntercomBottomPaddingOptions { value: number;}IntercomPushTokenOptions
Pilihan Token Push Intercomexport interface IntercomPushTokenOptions { value: string;}Sumber Kebenaran
Pengaturan Sumber KebenaranHalaman ini dihasilkan dari plugin’s src/definitions.ts. Re-run sinkronisasi ketika publik API berubah di atas
Teruskan dari Getting Started
Pengaturan Teruskan dari Getting StartedJika Anda menggunakan Panduan Getting Started untuk merencanakan dashboard dan API operasi, hubungkannya dengan Menggunakan @capgo/capacitor-intercom untuk kemampuan asli dalam Menggunakan @capgo/capacitor-intercom, API Ringkasan untuk detail implementasi dalam API Ringkasan, Pendahuluan untuk detail implementasi dalam Pendahuluan, API Kunci untuk detail implementasi dalam API Kunci, dan Perangkat untuk detail implementasi dalam Perangkat.