메뉴로 이동

시작하기

설치

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

code를 native로 Apple의 attribution endpoint를 호출하고 싶다면 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);

애플은 유효한 토큰을 위해 속성 데이터가 준비 중인 동안 반환할 수 있습니다. 404 while attribution data is still being prepared for a valid token. The retry options control how often the native plugin retries before rejecting. See iOS 속성 for platform details.

Compatibility Alias

Compatibility Alias

GetReferrer() 는 앱이 cap-play-install-referrer.

const result = await InstallReferrer.GetReferrer();

New code should use getReferrer().