Getting Started
Kopieren Sie eine Einrichtungsanweisung 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“Sie können unsere AI-gestützte Einrichtung verwenden, um das Plugin zu installieren. Fügen Sie die Capgo-Fähigkeiten Ihrem AI-Tool mit der folgenden Befehlszeile hinzu:
npx skills add https://github.com/Cap-go/capgo-skills --skill capacitor-pluginsVerwenden Sie dann die folgende Anfrage:
Use the `capacitor-plugins` skill from `Cap-go/capgo-skills` to install the `@capgo/capacitor-install-referrer` plugin in my project.Wenn Sie die manuelle Einrichtung bevorzugen, installieren Sie das Plugin, indem Sie die folgenden Befehle ausführen und die unten angegebenen Plattform-spezifischen Anweisungen befolgen:
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 möchten, dass native code den Apple-Attributionsendpunkt aufruft, 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 404 während die Attributionsdaten noch vorbereitet werden für einen gültigen Token. Die Wiederholungsoptionen steuern, wie oft der native Plugin vor der Ablehnung wiederholt. Siehe iOS-Attribution für Plattformdetails.
Kompatibilitätsalias
Abschnitt mit dem Titel “Kompatibilitätsalias”GetReferrer() ist für Apps verfügbar, die von cap-play-install-referrer.
const result = await InstallReferrer.GetReferrer();Neu code sollte code verwenden getReferrer().
Weitergehen von Getting Started
Abschnitt mit dem Titel “Weitergehen von Getting Started”Wenn Sie __CAPGO_KEEP_0__ verwenden Getting Started um native Plugin-Arbeit zu planen, verbinden Sie es mit Mit @capgo/capacitor-install-referrer für die native Fähigkeit in Mit @capgo/capacitor-install-referrer, Capgo Plugin-Verzeichnis für den Produktworkflow in Capgo Plugin-Verzeichnis, Capacitor Plugins durch Capgo für die Implementierungsdetails in Capacitor Plugins durch Capgo Plugins hinzufügen oder aktualisieren für die Implementierungsdetails in Plugins hinzufügen oder aktualisieren, und Ionic Enterprise-Plugin-Alternativen für den Produktworkflow in Ionic Enterprise-Plugin-Alternativen.