For the complete documentation index, see llms.txt. This page is also available as Markdown.

GoogleAdMob.showAppsInTossAdMob

Feature description

GoogleAdMob.loadAppsInTossAdMobShow AdMob ads that were preloaded with this method to users. Events that occur during the ad display process are onEvent delivered sequentially via callbacks.

It works in an event-driven style and returns a function that unregisters the AppBridge callback. Be sure to release it when the ad closes.

Before calling GoogleAdMob.showAppsInTossAdMob.isSupported()You can check whether it is supported with

Type

GoogleAdMob.showAppsInTossAdMob(params: ShowAdMobParams): () => void;

Params

interface ShowAdMobParams {
  options: ShowAdMobOptions;
  onEvent: (event: ShowAdMobEvent) => void;
  onError: (error: unknown) => void;
}

type ShowAdMobOptions = {
  /** This is the same ad group ID used in loadAppsInTossAdMob. */
  adGroupId: string;
};

type ShowAdMobEvent =
  | { type: "requested" }
  | { type: "show" }
  | { type: "impression" }
  | { type: "clicked" }
  | { type: "dismissed" }
  | { type: "failedToShow" }
  | {
      type: "userEarnedReward";
      data: { unitType: string; unitAmount: number };
    };

Event type Value:

type
Description

requested

The request to show the ad succeeded

show

The ad was displayed on screen

impression

The ad impression was recorded (the point at which revenue is generated)

clicked

The user clicked the ad

dismissed

The user closed the ad

failedToShow

Failed to show the ad

userEarnedReward

The user earned a reward (reward ads only)

Response

Function to unregister the AppBridge callback (() => void).

Error

If showing the ad fails failedToShow event or onError It is delivered via callback. Reward ads userEarnedReward should only award a reward when the event occurs. dismissedcannot tell whether the user watched the ad to the end by itself.

Example code

Was this helpful?