GoogleAdMob.isAppsInTossAdMobLoaded
Feature description
Check whether the AdMob ads for the specified ad group have loaded properly. Use this to check the load status before displaying an ad.
Before calling GoogleAdMob.isAppsInTossAdMobLoaded.isSupported()You can check whether it is supported with
Type
GoogleAdMob.isAppsInTossAdMobLoaded(options: IsAdMobLoadedOptions): Promise<boolean>;Params
type IsAdMobLoadedOptions = {
/** The ad group ID to check. */
adGroupId: string;
};Response
If the ad is loaded trueis returned.
Example code
import { Ads } from "@apps-in-toss/web-framework";
async function checkAdLoaded() {
try {
const isLoaded = await GoogleAdMob.isAppsInTossAdMobLoaded({
adGroupId: "AD_GROUP_ID",
});
console.log(isLoaded ? "Ad ready" : "The ad is not ready yet.");
} catch (error) {
console.error(error);
}
}Was this helpful?