컨텐츠로 바로가기

__CAPGO_KEEP_4__

설치

설치
터미널 창
bun add @capgo/capacitor-admob
bunx cap sync

import

import
import { AdMob } from '@capgo/capacitor-admob';

Initialize and start the AdMob 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'
});

__CAPGO_KEEP_2__

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

__CAPGO_KEEP_3__

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

__CAPGO_KEEP_4__

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

__CAPGO_KEEP_5__

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

trackingAuthorizationStatus

trackingAuthorizationStatus 제목

iOS에서만 현재 추적 권한 상태를 가져옵니다.

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

requestTrackingAuthorization

requestTrackingAuthorization 제목

사용자에게 iOS에서만 추적 권한을 요청합니다.

import { AdMob } from '@capgo/capacitor-admob';
const { status } = await AdMob.requestTrackingAuthorization();
console.log('User tracking status:', status);

AdMob의 구성 옵션입니다.

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

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[];
};

모바일 광고 기본 옵션

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

TrackingAuthorizationStatus

앱 추적 허용 상태

iOS 앱 추적 허용 상태

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

광고 콘텐츠 등급

광고 콘텐츠 등급 제한

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

원천

원천

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

시작하기

시작하기

이러한 기능을 사용하고 있다면 시작하기 대시보드 및 API 연산을 계획하려면 Using @capgo/capacitor-admob Using @capgo/capacitor-admob API 개요 API 개요에 대한 구현 세부 정보를 위해 소개 __CAPGO_KEEP_0__ 키에 대한 구현 세부 정보를 위해 API 키 API 키에 대한 구현 세부 정보를 위해 장치 __CAPGO_KEEP_0__에 대한 구현 세부 정보를 위해