Zum Inhalt springen

Einstieg

GitHub

Installieren

Einrichten
Terminalfenster
bun add @capgo/capacitor-install-referrer
bunx cap sync
import { InstallReferrer } from '@capgo/capacitor-install-referrer';
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);
}

Wenn Sie native code-Funktionen aufrufen möchten, die das Apple-Attributions-Endpunkt aufrufen, übergeben 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 abgelehnt wird. Siehe iOS Attribution für Plattformdetails.

GetReferrer() für Apps, die von cap-play-install-referrer.

const result = await InstallReferrer.GetReferrer();

Neue code sollten getReferrer().

Wenn Sie Einstieg um native Plugin-Arbeit zu planen, verbinden Sie es mit Mit @capgo/capacitor-install-referrer verwenden für die native Fähigkeit in Mit @capgo/capacitor-install-referrer, Capgo Plugin-Ordner für den Produktworkflow in Capgo Plugin-Ordner, Capacitor Plugins von Capgo für die Implementierungsdetail in Capacitor Plugins von Capgo, Plugins hinzufügen oder aktualisieren für die Implementierungsdetail in Plugins hinzufügen oder aktualisieren, und Ionic Enterprise Plugin Alternativen für den Produktworkflow in Ionic Enterprise Plugin Alternativen.