Inizia a utilizzare
Copiare una riga di impostazione con i passaggi di installazione e la guida markdown completa per questo plugin.
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.
Installare
Sezione intitolata “Installare”bun add @capgo/capacitor-install-referrerbunx cap syncImporta
Sezione intitolata “Importa”import { InstallReferrer } from '@capgo/capacitor-install-referrer';Leggi i dettagli di attribuzione
Sezione intitolata “Leggi i dettagli di attribuzione”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);}Esegui Apple Attribution On iOS
Sezione intitolata “Esegui Apple Attribution On iOS”Se desideri che il nativo code chiami l'endpoint di attribuzione di Apple, passa 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);L'Apple può tornare 404 mentre i dati di attribuzione sono ancora in preparazione per un token valido. Le opzioni di retry controllano con quale frequenza il plugin nativo riprova prima di rifiutare. vedere Attribuzione iOS
per i dettagli della piattaforma.
Compatibilità AliasGetReferrer() Sezione intitolata “Compatibilità Alias” cap-play-install-referrer.
const result = await InstallReferrer.GetReferrer();New code should use getReferrer().