Getting Started
이 플러그인의 설치 단계와 전체 마크다운 가이드를 포함한 설정 프롬프트를 복사하세요.
Set up this Capacitor plugin in the project.
Use the package manager already used by the project.
Install these package(s): `@capgo/capacitor-admob`
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/admob/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.
설치
설치AI-Assisted Setup을 사용하여 플러그인을 설치할 수 있습니다. AI 도구에 Capgo 스킬을 추가하려면 다음 명령어를 사용하세요:
npx skills add https://github.com/Cap-go/capgo-skills --skill capacitor-plugins다음과 같은 프롬프트를 사용하세요:
Use the `capacitor-plugins` skill from `Cap-go/capgo-skills` to install the `@capgo/capacitor-admob` plugin in my project.만약 Manual Setup을 선호한다면, 플러그인을 설치하기 위해 다음 명령어를 실행하고 아래의 플랫폼별 지침을 따르세요:
bun add @capgo/capacitor-admobbunx cap syncimport { AdMob } from '@capgo/capacitor-admob';API 개요
Section titled “API 개요”SDK AdMob 초기화 및 시작
import { AdMob } from '@capgo/capacitor-admob';
await AdMob.start();configure
Section titled “configure”AdMob 설정 구성
import { AdMob } from '@capgo/capacitor-admob';
await AdMob.configure({ appMuted: false, appVolume: 0.5});configRequest
Section titled “configRequest”광고 요청 설정 구성
import { AdMob } from '@capgo/capacitor-admob';
await AdMob.configRequest({ maxAdContentRating: MaxAdContentRating.PG, tagForChildDirectedTreatment: true, testDeviceIds: ['test-device-id']});adCreate
__CAPGO_KEEP_1____CAPGO_KEEP_2__
import { AdMob } from '@capgo/capacitor-admob';
await AdMob.adCreate({ adUnitId: 'ca-app-pub-3940256099942544/1033173712'});adIsLoaded
__CAPGO_KEEP_1____CAPGO_KEEP_3__
import { AdMob } from '@capgo/capacitor-admob';
const isLoaded = await AdMob.adIsLoaded({ id: 1 });if (isLoaded) { await AdMob.adShow({ id: 1 });}adLoad
__CAPGO_KEEP_1____CAPGO_KEEP_4__
import { AdMob } from '@capgo/capacitor-admob';
await AdMob.adLoad({ id: 1 });adShow
__CAPGO_KEEP_1____CAPGO_KEEP_5__
import { AdMob } from '@capgo/capacitor-admob';
await AdMob.adShow({ id: 1 });adHide
__CAPGO_KEEP_1____CAPGO_KEEP_2__
import { AdMob } from '@capgo/capacitor-admob';
await AdMob.adHide({ id: 1 });trackingAuthorizationStatus
__CAPGO_KEEP_1____CAPGO_KEEP_3__
import { AdMob } from '@capgo/capacitor-admob';
const { status } = await AdMob.trackingAuthorizationStatus();if (status === TrackingAuthorizationStatus.notDetermined) { await AdMob.requestTrackingAuthorization();}requestTrackingAuthorization
__CAPGO_KEEP_1____CAPGO_KEEP_4__
import { AdMob } from '@capgo/capacitor-admob';
const { status } = await AdMob.requestTrackingAuthorization();console.log('User tracking status:', status);__CAPGO_KEEP_5__
__CAPGO_KEEP_1__AdMobConfig
AdMobConfig 섹션 제목AdMob 설정 옵션.
export type AdMobConfig = { /** Whether the app should be muted */ appMuted?: boolean; /** The app volume (0.0 to 1.0) */ appVolume?: number;};RequestConfig
RequestConfig 섹션 제목광고 요청 설정.
export type RequestConfig = { /** Maximum ad content rating */ maxAdContentRating?: MaxAdContentRating; /** Whether to use the same app key */ sameAppKey?: boolean; /** Tag for child-directed treatment (true, false, or null for unspecified) */ tagForChildDirectedTreatment?: boolean | null; /** Tag for under age of consent (true, false, or null for unspecified) */ tagForUnderAgeOfConsent?: boolean | null; /** Array of test device IDs */ testDeviceIds?: string[];};MobileAdOptions
MobileAdOptions 섹션 제목모바일 광고 기본 옵션.
export type MobileAdOptions = { /** The ad unit ID from AdMob */ adUnitId: string;};TrackingAuthorizationStatus
TrackingAuthorizationStatus 섹션 제목iOS App Tracking Transparency에 대한 추적 허용 상태.
export enum TrackingAuthorizationStatus { /** User has not yet received an authorization request */ notDetermined = 0, /** User restricted, device is unable to provide authorization */ restricted = 1, /** User denied authorization */ denied = 2, /** User authorized access */ authorized = 3,}MaxAdContentRating
Section titled “MaxAdContentRating”콘텐츠 등급에 따라 광고를 제한하기 위해 사용하는 최대 광고 콘텐츠 등급 열거형.
export enum MaxAdContentRating { /** General Audiences */ G = 'G', /** Mature Audiences */ MA = 'MA', /** Parental Guidance */ PG = 'PG', /** Teen */ T = 'T', /** Unspecified rating */ UNSPECIFIED = '',}진실의 근원
Section titled “진실의 근원”이 페이지는 플러그인의 src/definitions.ts. upstream에서 변경된 public API에 대해 다시 동기화할 때.
Getting Started에서 계속하기
Section titled “Getting Started에서 계속하기”Capgo를 사용하는 경우 Getting Started 대시보드와 API를 계획하고 운영하기 위해, 그것을 연결하세요. @capgo/capacitor-admob @capgo/capacitor-admob API 개요 API 개요 소개 소개 API 키 API 키 기기 기기