💡Tips
- The ad status query API allows you to check whether an ad has finished loading, whether it is currently loading, and view the list of currently cached ads before showing an ad.
- Supports querying the status of Interstitial ads, Rewarded Video ads, and App Open ads.
- It is recommended to call the corresponding status query method before showing an ad to optimize ad display timing and user experience.
The HyperBid Flutter SDK provides ad status query APIs that return an McAdStatusInfo object containing the following information:
| Field | Type | Description |
|---|---|---|
isLoading |
bool |
Whether an ad is currently loading |
isReady |
bool |
Whether an ad has loaded and is ready to show |
adList |
List<McAd> |
List of currently cached ad information |
McAdStatusInfo statusInfo = await McSdk.checkInterstitialAdStatus("your mediation unit id");
print("Is loading: ${statusInfo.isLoading}");
print("Is the ad ready to show: ${statusInfo.isReady}");
print("Number of cached ads: ${statusInfo.adList.length}");
McAdStatusInfo statusInfo = await McSdk.checkRewardedAdStatus("your mediation unit id");
print("Is loading: ${statusInfo.isLoading}");
print("Is the ad ready to show: ${statusInfo.isReady}");
print("Number of cached ads: ${statusInfo.adList.length}");
McAdStatusInfo statusInfo = await McSdk.checkAppOpenAdStatus("your mediation unit id");
print("Is loading: ${statusInfo.isLoading}");
print("Is the ad ready to show: ${statusInfo.isReady}");
print("Number of cached ads: ${statusInfo.adList.length}");
Through the adList field, you can view detailed information for each currently cached ad:
// Using Rewarded Video as an example
McAdStatusInfo statusInfo = await McSdk.checkRewardedAdStatus("your mediation unit id");
for (McAd ad in statusInfo.adList) {
print("Mediation Unit ID: ${ad.adUnitId}");
print("Ad Network: ${ad.networkName}");
print("Mediation Placement ID: ${ad.mediationPlacementId}");
print("Estimated revenue: ${ad.revenue} ${ad.currency}");
print("---");
}
📌 Ads in
adListare ordered by cache sequence. Cached ad information can be used for data analysis and logging.⚠️ Note: Status queries are asynchronous operations. Please use
awaitto wait for the result before proceeding with subsequent logic.