내용으로 건너뛰기

시작하기

터미널 창
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);
}

If you want native code to call Apple’s attribution endpoint, pass 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);

Attribution 정보가 아직 유효한 토큰을 위해 준비 중인 경우, 404 iOS attribution 플랫폼 세부 정보를 참조하십시오.

호환성 별칭

호환성 별칭 섹션

GetReferrer() Capacitor로 이전하는 앱에 사용할 수 있습니다. cap-play-install-referrer.

const result = await InstallReferrer.GetReferrer();

Capacitor로 이전하는 앱은 code을 사용해야 합니다. getReferrer().