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.
Anda dapat menggunakan Pengaturan Bantu AI kami 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-pluginsKemudian 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 Setup Manual, instal plugin dengan menjalankan perintah-perintah berikut dan ikuti instruksi spesifik platform di bawah ini:
bun add @capgo/capacitor-intercombunx cap syncimport { CapgoIntercom } from '@capgo/capacitor-intercom';Ringkasan API
Bagian berjudul âRingkasan APIâloadWithKeys
Bagian 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({} as IntercomLoadOptions);registerIdentifiedUser
Bagian berjudul â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
Bagian berjudul â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);Log pengguna keluar dari Intercom.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.logout();logEvent
Bagian berjudul âlogEventâLog sebuah acara kustom di Intercom.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.logEvent({} as IntercomLogEventOptions);displayMessenger
Bagian berjudul âtampilkanPesanPenggunaâBuka pesan pengguna Intercom.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.displayMessenger();displayMessageComposer
Bagian berjudul âtampilkanKomposerPesanâ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 launcher Intercom.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.displayLauncher();hideLauncher
Bagian berjudul âhideLauncherâTutup tombol launcher 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âAtur JWT untuk autentikasi pesan aman.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.setUserJwt({} as IntercomUserJwtOptions);setBottomPadding
Bagian berjudul âsetBottomPaddingâAtur padding bawah untuk antarmuka UI pesan Intercom.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.setBottomPadding({} as IntercomBottomPaddingOptions);sendPushTokenToIntercom
Bagian berjudul âsendPushTokenToIntercomâKirimkan token pemberitahuan push ke Intercom.
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.sendPushTokenToIntercom({} as IntercomPushTokenOptions);receivePush
Bagian berjudul âreceivePushâTangani pemberitahuan 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
Bagian berjudul âIntercomBottomPaddingOptionsâexport interface IntercomBottomPaddingOptions { value: number;}IntercomPushTokenOptions
Bagian berjudul âIntercomPushTokenOptionsâexport interface IntercomPushTokenOptions { value: string;}Sumber Kebenaran
Section berjudul âSumber KebenaranâHalaman ini dibuat dari pluginâs src/definitions.ts. Jalankan ulang sinkronisasi ketika API publik berubah di atas
Teruskan dari Getting Started
Section berjudul âTeruskan dari Getting StartedâJika Anda menggunakan Getting Started untuk merencanakan dashboard dan API operasi, hubungkannya dengan Menggunakan @capgo/capacitor-intercom untuk kemampuan asli di Menggunakan @capgo/capacitor-intercom, API Ringkasan untuk detail implementasi di API Ringkasan, Pengenalan untuk detail implementasi di Pengenalan, Kunci API untuk detail implementasi di Kunci API dan Perangkat untuk detail implementasi di Perangkat.