Skip to content

Getting Started

GitHub

__CAPGO_KEEP_3__

설치

Capgo을 사용하여 플러그인을 설치할 수 있습니다. 다음 명령어를 사용하여 Capgo 기능을 AI 도구에 추가하세요.

터미널 창
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-admob
bunx cap sync
import { AdMob } from '@capgo/capacitor-admob';

API 개요

API 개요

SDK 초기화 및 시작

import { AdMob } from '@capgo/capacitor-admob';
await AdMob.start();

AdMob 설정

import { AdMob } from '@capgo/capacitor-admob';
await AdMob.configure({
appMuted: false,
appVolume: 0.5
});

광고 요청 설정

import { AdMob } from '@capgo/capacitor-admob';
await AdMob.configRequest({
maxAdContentRating: MaxAdContentRating.PG,
tagForChildDirectedTreatment: true,
testDeviceIds: ['test-device-id']
});

새로운 광고 인스턴스 생성

import { AdMob } from '@capgo/capacitor-admob';
await AdMob.adCreate({
adUnitId: 'ca-app-pub-3940256099942544/1033173712'
});

광고가 로드되어 표시될 준비가 된지 확인합니다.

import { AdMob } from '@capgo/capacitor-admob';
const isLoaded = await AdMob.adIsLoaded({ id: 1 });
if (isLoaded) {
await AdMob.adShow({ id: 1 });
}

광고를 로드합니다.

import { AdMob } from '@capgo/capacitor-admob';
await AdMob.adLoad({ id: 1 });

로드된 광고를 표시합니다.

import { AdMob } from '@capgo/capacitor-admob';
await AdMob.adShow({ id: 1 });

현재 표시 중인 광고를 숨깁니다.

import { AdMob } from '@capgo/capacitor-admob';
await AdMob.adHide({ id: 1 });

trackingAuthorizationStatus

__CAPGO_KEEP_1__

__CAPGO_KEEP_2__

import { AdMob } from '@capgo/capacitor-admob';
const { status } = await AdMob.trackingAuthorizationStatus();
if (status === TrackingAuthorizationStatus.notDetermined) {
await AdMob.requestTrackingAuthorization();
}

requestTrackingAuthorization

__CAPGO_KEEP_3__

__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_6__

AdMobConfig

__CAPGO_KEEP_7__

__CAPGO_KEEP_0__

export type AdMobConfig = {
/** Whether the app should be muted */
appMuted?: boolean;
/** The app volume (0.0 to 1.0) */
appVolume?: number;
};

RequestConfig

__CAPGO_KEEP_0__

__CAPGO_KEEP_1__

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

__CAPGO_KEEP_0__

__CAPGO_KEEP_1__

export type MobileAdOptions = {
/** The ad unit ID from AdMob */
adUnitId: string;
};

TrackingAuthorizationStatus

__CAPGO_KEEP_0__

__CAPGO_KEEP_1__

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

__CAPGO_KEEP_0__

__CAPGO_KEEP_1__

export enum MaxAdContentRating {
/** General Audiences */
G = 'G',
/** Mature Audiences */
MA = 'MA',
/** Parental Guidance */
PG = 'PG',
/** Teen */
T = 'T',
/** Unspecified rating */
UNSPECIFIED = '',
}

원본

원본

이 페이지는 플러그인의 src/definitions.ts. 업스트림의 공공 API이 변경될 때 다시 싱크를 실행하세요.

시작부터 계속

시작부터 계속

이러한 기능을 사용하고 계신가요? 시작 계획 대시보드 및 API 운영을 위해 Using @capgo/capacitor-admob Using @capgo/capacitor-admob API 개요 API 구현 세부 정보에 대한 소개 소개 __CAPGO_KEEP_0__ 키 API 키 구현 세부 정보에 대한 소개, 및 for the implementation detail in API Keys, and 구현 세부 정보에 대한 소개 장치. 수정 페이지