Empezar
Copiar una solicitud de configuración con los pasos de instalación y la guía de markdown completa para este 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.
Instalar
Sección titulada “Instalar”bun add @capgo/capacitor-install-referrerbunx cap syncImportar
Sección titulada “Importar”import { InstallReferrer } from '@capgo/capacitor-install-referrer';Leer detalles de atribución
Sección titulada “Leer detalles de atribución”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);}Obtener atribución de Apple en iOS
Sección titulada “Obtener atribución de Apple en iOS”Si deseas que el nativo code llame al punto de conexión de atribución de Apple, pasa 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);Apple puede devolver 404 mientras que los datos de atribución aún se están preparando para un token válido. Las opciones de reintento controlan cuántas veces el plugin nativo vuelve a intentarlo antes de rechazar. Consulta atribución de iOS para detalles de plataforma.
Alias de compatibilidad
Sección titulada “Alias de compatibilidad”GetReferrer() está disponible para aplicaciones que migran desde cap-play-install-referrer.
const result = await InstallReferrer.GetReferrer();Nuevos code deben utilizar getReferrer().