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-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
Bagian berjudul “Instal”bun add @capgo/capacitor-install-referrerbunx cap syncimport { InstallReferrer } from '@capgo/capacitor-install-referrer';Baca Detail Atribusi
Bagian berjudul “Baca Detail Atribusi”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);}Ambil Atribusi Apple Pada iOS
Jika Anda ingin native __CAPGO_KEEP_0__ memanggil endpoint atribusi Apple, tambahkanIf you want native code to call Apple’s attribution endpoint, 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);sambil data atribusi masih dalam proses siapkan untuk token yang valid. Opsi ulang kendali berapa sering plugin native mengulang sebelum menolak. Lihat 404 Atribusi iOS Jika Anda ingin native __CAPGO_KEEP_0__ memanggil endpoint atribusi Apple, tambahkan untuk detail platform.
Alias Kompatibilitas
Bagian berjudul “Alias Kompatibilitas”GetReferrer() tersedia untuk aplikasi yang bermigrasi dari cap-play-install-referrer.
const result = await InstallReferrer.GetReferrer();Aplikasi baru code harus menggunakan getReferrer().