Mulai Menggunakan
Copas 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-install-referrer`
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/install-referrer/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
Bab berjudul “Instal”Kamu bisa menggunakan Setup Bantuan AI untuk menginstal plugin. Tambahkan Capgo kemampuan ke alat AI kamu 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-install-referrer` plugin in my project.Jika kamu lebih suka Setup Manual, instal plugin dengan menjalankan perintah-perintah berikut dan ikuti instruksi spesifik platform di bawah ini:
bun add @capgo/capacitor-install-referrerbunx cap syncImport
Judul Bagian “Import”import { InstallReferrer } from '@capgo/capacitor-install-referrer';Baca Detail Pengakuan
Judul Bagian “Baca Detail Pengakuan”const result = await InstallReferrer.getReferrer();
if (result.platform === 'android') { console.log('Install referrer:', result.referrer); console.log('Click timestamp:', result.clickTimestampSeconds); console.log('Install timestamp:', result.installBeginTimestampSeconds);}
if (result.platform === 'ios') { console.log('AdServices token:', result.attributionToken);}Dapatkan Pengakuan Apple Pada iOS
Judul Bagian “Dapatkan Pengakuan Apple Pada iOS”Jika Anda ingin native code memanggil endpoint pengakuan Apple, pass fetchAppleAttribution.
const result = await InstallReferrer.getReferrer({ fetchAppleAttribution: true, appleAttributionRetryCount: 3, appleAttributionRetryDelayMs: 5000,});
// result.appleAttribution is the parsed Apple attribution response.// See the iOS attribution page for the Apple-provided payload fields.console.log(result.appleAttribution);Pengakuan Apple dapat kembali 404 sementara data pengakuan masih dalam proses siapkan untuk token yang valid. Opsi ulang kendali berapa sering plugin native mengulang sebelum menolak. Lihat Attribusi iOS untuk detail platform.
Alias Kompabilitas
Judul Bagian “Alias Kompabilitas”GetReferrer() tersedia untuk aplikasi yang bermigrasi dari cap-play-install-referrer.
const result = await InstallReferrer.GetReferrer();Baru code harus menggunakan getReferrer().
Teruskan dari Getting Started
Judul Bagian “Teruskan dari Getting Started”Jika Anda menggunakan Mulai Menggunakan untuk merencanakan pekerjaan plugin native, hubungkannya dengan Gunakan @capgo/capacitor-install-referrer untuk kemampuan native di Gunakan @capgo/capacitor-install-referrer, Capgo Direktori Plugin untuk alur kerja produk di Capgo Direktori Plugin, Capacitor Plugin oleh Capgo untuk detail implementasi di Capacitor Plugin oleh Capgo, Menambahkan atau Mengupdate Plugin untuk detail implementasi di Menambahkan atau Mengupdate Plugin, dan Alternatif Plugin Enterprise Ionic untuk alur kerja produk di Alternatif Plugin Enterprise Ionic.