Einstieg
Kopieren Sie eine Einrichtungsanleitung mit den Installationsanweisungen und der vollständigen Markdown-Anleitung für diesen 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.
Installieren
Abschnitt mit dem Titel "Installieren"bun add @capgo/capacitor-install-referrerbunx cap syncImportieren
Abschnitt mit dem Titel „Importieren“import { InstallReferrer } from '@capgo/capacitor-install-referrer';Attributionsdetails lesen
Abschnitt mit dem Titel „Attributionsdetails lesen“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);}Apple-Attributionsabrufen auf iOS
Abschnitt mit dem Titel „Apple-Attributionsabrufen auf iOS“Wenn Sie native code-Funktionen möchten, die das Apple-Attributions-Endpunkt aufrufen, geben Sie 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 kann zurückgeben 404 solange die Attribution-Daten noch vorbereitet werden für einen gültigen Token. Die Wiederholungsoptionen steuern, wie oft der native Plugin wiederholt, bevor er ablehnt. Siehe iOS Attribution
für Plattformdetails.
Compatibility AliasGetReferrer() Zur Verfügung steht für Apps, die von cap-play-install-referrer.
const result = await InstallReferrer.GetReferrer();Neue code sollten getReferrer().