시작하기
복사할 수 있는 설정 명령어와 이 플러그인의 전체 마크다운 가이드를 포함한 설치 단계를 복사하세요.
Set up this Capacitor plugin in the project.
Use the package manager already used by the project.
Install these package(s): `@capgo/capacitor-install-referrer`
Run the required Capacitor sync/update step after installation.
Read this markdown guide for the full setup steps: https://raw.githubusercontent.com/Cap-go/website/refs/heads/main/apps/docs/src/content/docs/docs/plugins/install-referrer/getting-started.mdx
Use that guide for platform-specific steps, native file edits, permissions, config changes, imports, and usage setup.
If that guide references other docs pages, read them too.
설치
설치bun add @capgo/capacitor-install-referrerbunx cap syncImport
‘Import’라는 제목의 섹션import { InstallReferrer } from '@capgo/capacitor-install-referrer';Attribution 정보 읽기
‘Attribution 정보 읽기’라는 제목의 섹션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);}iOS에서 Apple Attribution 가져오기
‘iOS에서 Apple Attribution 가져오기’라는 제목의 섹션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 AliasGetReferrer() 는 앱이 cap-play-install-referrer.
const result = await InstallReferrer.GetReferrer();New code should use getReferrer().