Zum Inhalt springen

Getting Started

GitHub

Installationsabschnitt

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 mithilfe der folgenden Befehl hinzu:

Terminalfenster
npx skills add https://github.com/Cap-go/capgo-skills --skill capacitor-plugins

Verwenden 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 untenstehenden plattform-spezifischen Anweisungen befolgen:

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, 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 die native Plugin wiederholt, bevor es abgelehnt wird. Siehe iOS-Attribution für Plattformdetails.

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

const result = await InstallReferrer.GetReferrer();

Neue code sollten getReferrer().

Wenn Sie native Plugin-Arbeit planen, verbinden Sie es mit Getting Started Um native Plugin-Arbeit zu planen, verbinden Sie es mit für die native Fähigkeit in Using @capgo/capacitor-install-referrer für die native Fähigkeit in Using @capgo/capacitor-install-referrer, Capgo Plugin-Ordner für den Produktworkflow in Capgo Plugin-Ordner, Capacitor Plugins von Capgo zur Implementierungsdetail in Capacitor Plugins von Capgo, Hinzufügen oder Aktualisieren von Plugins zur Implementierungsdetail in Hinzufügen oder Aktualisieren von Plugins, und Ionische Unternehmensplugin-Alternativen zur Produktworkflow in Ionische Unternehmensplugin-Alternativen.