Mulai Menggunakan
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.
Instalasi
Bab berjudul “Instalasi”Anda dapat menggunakan Pengaturan Bantu AI untuk menginstal plugin. Tambahkan Capgo kemampuan ke alat AI Anda menggunakan perintah berikut:
npx skills add https://github.com/Cap-go/capgo-skills --skill capacitor-pluginsLalu gunakan prompt berikut:
Use the `capacitor-plugins` skill from `Cap-go/capgo-skills` to install the `@capgo/capacitor-intercom` plugin in my project.Jika Anda lebih suka Pengaturan Manual, instal plugin dengan menjalankan perintah-perintah berikut dan ikuti instruksi spesifik platform di bawah ini:
bun add @capgo/capacitor-intercombunx cap syncImport
Bab berjudul “Import”import { CapgoIntercom } from '@capgo/capacitor-intercom';API Pengantar
Bab berjudul “API Pengantar”loadWithKeys
Bab berjudul “loadWithKeys”Mulai 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({ appId: 'app-id-123', apiKeyIOS: 'api-key-ios', apiKeyAndroid: 'api-key-android',});registerIdentifiedUser
Bab berjudul “registerIdentifiedUser”Mendaftarkan pengguna yang dikenal dengan Intercom. Setidaknya salah satu userId atau email harus disediakan.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.registerIdentifiedUser({ userId: 'user-id-123', email: 'user@example.com',});registerUnidentifiedUser
Membuat Pengguna Tidak TeridentifikasiMendaftarkan pengguna anonim dengan Intercom.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.registerUnidentifiedUser();updateUser
Section titled “updateUser”Mengupdate atribut pengguna di Intercom.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.updateUser({ userId: 'user-id-123' });logout
Section titled “logout”Mengeluarkan pengguna dari Intercom.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.logout();logEvent
Section titled “logEvent”Mengirimkan event kustom di Intercom.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.logEvent({ name: 'example' });displayMessenger
Judul Bagian berjudul “displayMessenger”Buka pesan Intercom.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.displayMessenger();displayMessageComposer
Judul Bagian berjudul “displayMessageComposer”Buka komposer pesan dengan pesan yang sudah diisi.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.displayMessageComposer({ message: 'Hello from Capacitor' });displayHelpCenter
Judul Bagian berjudul “displayHelpCenter”Buka pusat bantuan Intercom.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.displayHelpCenter();hideMessenger
Judul Bagian berjudul “hideMessenger”Sembunyikan pesan Intercom.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.hideMessenger();displayLauncher
Judul Bagian “displayLauncher”Tampilkan tombol launcher Intercom.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.displayLauncher();hideLauncher
Judul Bagian “hideLauncher”Sembunyikan tombol launcher Intercom.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.hideLauncher();displayInAppMessages
Judul Bagian “displayInAppMessages”Aktifkan pesan dalam aplikasi dari Intercom.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.displayInAppMessages();hideInAppMessages
Judul Bagian “hideInAppMessages”Matikan pesan dalam aplikasi dari Intercom.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.hideInAppMessages();displayCarousel
Judul Bagian ‘displayCarousel’Tampilkan carousel Intercom tertentu.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.displayCarousel({ carouselId: 'carousel-id-123' });displayArticle
Judul Bagian ‘displayArticle’Tampilkan artikel Intercom tertentu.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.displayArticle({ articleId: 'article-id-123' });displaySurvey
Judul Bagian ‘displaySurvey’Tampilkan survei Intercom tertentu.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.displaySurvey({ surveyId: 'survey-id-123' });setUserHash
Judul Bagian ‘setUserHash’Setel HMAC untuk verifikasi identitas.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.setUserHash({ hmac: 'hmac' });setUserJwt
Judul Bagian ‘setUserJwt’Set JWT untuk autentikasi pesan messenger yang aman.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.setUserJwt({ jwt: 'jwt' });setBottomPadding
Judul Bagian ‘setBottomPadding’Set jarak bawah untuk antarmuka UI messenger Intercom.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.setBottomPadding({ value: 1 });sendPushTokenToIntercom
Judul Bagian ‘sendPushTokenToIntercom’Kirimkan token notifikasi push ke Intercom.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.sendPushTokenToIntercom({ value: 'value' });receivePush
Judul Bagian ‘receivePush’Penerima notifikasi push dari Intercom.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.receivePush({});getUnreadConversationCount
Judul Bagian berjudul “getUnreadConversationCount”Peroleh jumlah percakapan yang belum dibaca untuk pengguna saat ini.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
const result = await CapgoIntercom.getUnreadConversationCount();console.log(result);Referensi Tipe
Judul Bagian berjudul “Referensi Tipe”IntercomLoadOptions
Judul Bagian berjudul “IntercomLoadOptions”export interface IntercomLoadOptions { appId?: string; apiKeyIOS?: string; apiKeyAndroid?: string;}IntercomIdentifiedUserOptions
Judul Bagian berjudul “IntercomIdentifiedUserOptions”export interface IntercomIdentifiedUserOptions { userId?: string; email?: string;}IntercomUserUpdateOptions
Judul Bagian berjudul “IntercomUserUpdateOptions”export interface IntercomUserUpdateOptions { userId?: string; email?: string; name?: string; phone?: string; languageOverride?: string; customAttributes?: { [key: string]: any }; companies?: IntercomCompany[];}IntercomLogEventOptions
Judul Bagian berjudul “IntercomLogEventOptions”export interface IntercomLogEventOptions { name: string; data?: { [key: string]: any };}IntercomMessageComposerOptions
Bab berjudul “IntercomMessageComposerOptions”export interface IntercomMessageComposerOptions { message: string;}IntercomCarouselOptions
Bab berjudul “IntercomCarouselOptions”export interface IntercomCarouselOptions { carouselId: string;}IntercomArticleOptions
Bab berjudul “IntercomArticleOptions”export interface IntercomArticleOptions { articleId: string;}IntercomSurveyOptions
Bab berjudul “IntercomSurveyOptions”export interface IntercomSurveyOptions { surveyId: string;}IntercomUserHashOptions
Bab berjudul “IntercomUserHashOptions”export interface IntercomUserHashOptions { hmac: string;}IntercomUserJwtOptions
Bab berjudul “IntercomUserJwtOptions”export interface IntercomUserJwtOptions { jwt: string;}IntercomBottomPaddingOptions
Bagian berjudul “IntercomBottomPaddingOptions”export interface IntercomBottomPaddingOptions { value: number;}IntercomPushTokenOptions
Bagian berjudul “IntercomPushTokenOptions”export interface IntercomPushTokenOptions { value: string;}Sumber Kebenaran
Bagian berjudul “Sumber Kebenaran”Halaman ini dihasilkan dari plugin’s src/definitions.tsRe-run sinkronisasi ketika API publik berubah di atas
Lanjutkan dari Getting Started
Bagian berjudul “Lanjutkan dari Getting Started”Jika Anda menggunakan Mulai Berjalan untuk merencanakan dashboard dan API operasi, hubungkannya dengan Menggunakan @capgo/capacitor-intercom untuk kemampuan asli di Menggunakan @capgo/capacitor-intercom, Ringkasan API untuk detail implementasi di Ringkasan API, Pendahuluan untuk detail implementasi di Pendahuluan, Kunci API untuk detail implementasi di Kunci API, dan Perangkat Untuk detail implementasi di Perangkat.