Getting Started
__CAPGO_KEEP_0__
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.
__CAPGO_KEEP_7__
__CAPGO_KEEP_8__bun add @capgo/capacitor-admobbunx cap sync__CAPGO_KEEP_11__
Section titled “インポート”import { AdMob } from '@capgo/capacitor-admob';API の概要
Section titled “API の概要”AdMob SDK を初期化して開始します。
import { AdMob } from '@capgo/capacitor-admob';
await AdMob.start();configure
Section titled “設定”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_3____CAPGO_KEEP_4__
import { AdMob } from '@capgo/capacitor-admob';
const { status } = await AdMob.trackingAuthorizationStatus();if (status === TrackingAuthorizationStatus.notDetermined) { await AdMob.requestTrackingAuthorization();}requestTrackingAuthorization
__CAPGO_KEEP_5____CAPGO_KEEP_0__
import { AdMob } from '@capgo/capacitor-admob';
const { status } = await AdMob.requestTrackingAuthorization();console.log('User tracking status:', status);__CAPGO_KEEP_7__
__CAPGO_KEEP_8__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
リクエストConfigセクション広告リクエストの設定
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
モバイル広告オプションセクションモバイル広告の基本オプション
export type MobileAdOptions = { /** The ad unit ID from AdMob */ adUnitId: string;};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
「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上流で変更されたパブリック API の再同期を行うときに再実行してください。
「Getting Started」から続けて
「Getting Started」セクション「Getting Started」を使用して ダッシュボードと __CAPGO_KEEP_0__ の計画と実行を行う場合、接続してください。 to plan dashboard and API operations, connect it with Using @capgo/capacitor-admob for the native capability in Using @capgo/capacitor-admob API アサイン for the implementation detail in API アサイン バースト for the implementation detail in バースト API カース for the implementation detail in API カース, 、、 クムスト for the implementation detail in クムスト