GoogleAdMob.loadAppsInTossAdMob
Feature description
Google AdMob ads are preloaded so they can be shown right away when needed. When an ad is successfully loaded onEvent as a callback type: 'loaded' the event is delivered.
Before calling GoogleAdMob.loadAppsInTossAdMob.isSupported()You can check whether it is supported with
Type
GoogleAdMob.loadAppsInTossAdMob(params: LoadAdMobParams): () => void;Params
interface LoadAdMobParams {
options: LoadAdMobOptions;
onEvent: (event: LoadAdMobEvent) => void;
onError: (error: unknown) => void;
}
type LoadAdMobOptions = {
/** This is the ad group ID. Please enter the value issued from the Apps in Toss console. */
adGroupId: string;
/** This is a value that distinguishes the source of the ad request. */
referrer?: string | null;
};
type LoadAdMobEvent = {
type: "loaded";
data: LoadAdMobResult;
};
type LoadAdMobResult = {
/** This is the ad group ID. */
adGroupId: string;
/** This is the ad ID. */
adUnitId: string;
/** This is the ad load response information. */
responseInfo: {
/** This is an array of ad network response information. */
adNetworkInfoArray: AdNetworkResponseInfo[];
/** This is the loaded ad network response information. */
loadedAdNetworkInfo: AdNetworkResponseInfo | null;
/** This is the ID that identifies the ad response. */
responseId: string | null;
};
};
type AdNetworkResponseInfo = {
/** This is the ad source ID. */
adSourceId: string;
/** This is the ad source name. */
adSourceName: string;
/** This is the ad source instance ID. */
adSourceInstanceId: string;
/** This is the ad source instance name. */
adSourceInstanceName: string;
/** This is the ad network class name. */
adNetworkClassName: string | null;
};Response
Returns an unsubscribe function (() => void). When called, events and errors that arrive afterward are not passed to the callback.
Error
If ad loading fails, onError an error is passed to the callback. If called outside the Toss app webview environment, an error occurs at the time of the call.
Example code
Was this helpful?