메인 콘텐츠로 건너뛰기
플러그인으로 돌아가기
@capgo/capacitor-install-referrer
튜토리얼
by github.com/Cap-go

설치 참조자

Capacitor에서 Google Play 설치 참조자 데이터 및 Apple AdServices Attribution을 읽습니다.

가이드

설치 참조자에 대한 튜토리얼

capgo/capacitor-install-referrer 사용

@capgo/capacitor-install-referrer Android 앱에서 Capacitor을 읽고 설치합니다.

API을 사용하여 Android와 iOS에서 하나의 플랫폼을 통해 Google Play 설치 참조 데이터와 Apple AdServices Attribution 토큰을 필요로 할 때.

설치

bun add @capgo/capacitor-install-referrer
bunx cap sync

이 플러그인은 무엇을 제공하는가

  • getReferrer __CAPGO_KEEP_0__에서 Android 또는 iOS의 설치 Attribution 세부 정보를 반환합니다.
  • GetReferrer __CAPGO_KEEP_0__의 이전 버전에서 Android로의 마이그레이션을 위해 deprecated한 호환성 별칭입니다. cap-play-install-referrer.
  • Android는 Play referrer 문자열, 클릭 시간, 설치 시간, 즉시 앱 플래그를 반환합니다.
  • iOS는 AdServices Attribution 토큰을 반환하고 Apple의 Attribution 페이로드를 선택적으로 가져올 수 있습니다.

예시 사용

import { InstallReferrer } from '@capgo/capacitor-install-referrer';

const result = await InstallReferrer.getReferrer();

if (result.platform === 'android') {
  console.log(result.referrer);
}

if (result.platform === 'ios') {
  console.log(result.attributionToken);
}

애플 Attribution 페이로드

const result = await InstallReferrer.getReferrer({
  fetchAppleAttribution: true,
  appleAttributionRetryCount: 3,
  appleAttributionRetryDelayMs: 5000,
});

console.log(result.appleAttribution);

플랫폼 노트

Android는 Google Play Install Referrer 서비스를 사용하고 실제 참조 데이터를 얻기 위해 Play Store 설치가 필요합니다. iOS는 Apple AdServices를 사용하는 이유는 Apple이 일반적인 App Store 설치 참조 데이터를 제공하지 않기 때문입니다.

전체 참조