Führung
Anleitung zum Installieren von Referrer
Mit @capgo/capacitor-install-referrer
@capgo/capacitor-install-referrer liest Install-Attributsignale in Capacitor-Apps.
Verwenden Sie es, wenn Sie Google Play Install Referrer-Daten auf Android und Apple AdServices-Attributschlüssel auf iOS über eine API nutzen möchten.
Installieren
bun add @capgo/capacitor-install-referrer
bunx cap sync
Was diese Plugin-Exposition enthält
getReferrergibt Install-Attributsdetails für Android oder iOS zurück.GetReferrerist ein veralteter Kompatibilitätsalias für die Migration voncap-play-install-referrer.- Android gibt die Play-Refererzeichenkette, Klickzeitstempel, Installationszeitstempel und Instant-App-Flag zurück.
- iOS gibt einen AdServices-Attributschlüssel zurück und kann optional Apple's Attribution-Payload abrufen.
Beispielhafte Verwendung
import { InstallReferrer } from '@capgo/capacitor-install-referrer';
const result = await InstallReferrer.getReferrer();
if (result.platform === 'android') {
console.log(result.referrer);
}
if (result.platform === 'ios') {
console.log(result.attributionToken);
}
Apple-Attributions-Payload
const result = await InstallReferrer.getReferrer({
fetchAppleAttribution: true,
appleAttributionRetryCount: 3,
appleAttributionRetryDelayMs: 5000,
});
console.log(result.appleAttribution);
Plattform Hinweise
Android verwendet die Google Play Install Referrer-Dienst und erfordert eine Play Store-Installation für echte Referrer-Daten. iOS verwendet Apple AdServices, da Apple kein generisches App Store-Install-Referrer-Äquivalent bereitstellt.
Vollständige Referenz
- GitHub: https://github.com/Cap-go/capacitor-install-referrer/
- Dokumentation: /docs/plugins/install-referrer/
Fortsetzen Sie mit der Verwendung von @capgo/capacitor-install-referrer
Wenn Sie die Verwendung von Die Verwendung von @capgo/capacitor-install-referrer um native Plugin-Arbeit zu planen, verbinden Sie es mit @capgo/capacitor-install-referrer für die Implementierungsdetails in @capgo/capacitor-install-referrer Einstieg annehmen für die Implementierungsdetails in Einstieg annehmen, Capgo Plugin Directory for the product workflow in Capgo Plugin Directory, Capacitor Plugins by Capgo for the implementation detail in Capacitor Plugins by Capgo, and Plugins hinzufügen oder aktualisieren für die Implementierungsdetails in Plugins hinzufügen oder aktualisieren.