시작하기
설치 단계와 이 플러그인의 전체 마크다운 가이드를 포함한 설정 프롬프트 복사
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
Section titled “Import”import { InstallReferrer } from '@capgo/capacitor-install-referrer';Attribution 정보 읽기
Section titled “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 가져오기
native __CAPGO_KEEP_0__가 Apple의 attribution endpoint를 호출하고 싶다면,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().