-
public interface CloudXNativeAdListenerCallbacks for native ad lifecycle events.
-
-
Method Summary
Modifier and Type Method Description abstract UnitonNativeAdLoaded(CloudXNativeAdView adView, CloudXAd ad)Native ad was loaded successfully. abstract UnitonNativeAdLoadFailed(String adUnitId, CloudXError error)Native ad failed to load. abstract UnitonNativeAdClicked(CloudXAd ad)Native ad was clicked. UnitonNativeAdExpired(CloudXAd ad)Native ad has expired and should no longer be displayed. UnitonNativeAdClosed(CloudXAd ad)Called when the user closes/hides the native ad via AdChoices (e.g., reports or dismisses the ad). -
-
Method Detail
-
onNativeAdLoaded
abstract Unit onNativeAdLoaded(CloudXNativeAdView adView, CloudXAd ad)
Native ad was loaded successfully.
- Parameters:
adView- The CloudXNativeAdView if loaded via CloudXNativeAdLoader.loadAd with a view, or null if loaded via the parameterless CloudXNativeAdLoader.loadAd (deferred rendering).ad- The ad metadata including ad unit, bidder, and revenue information.
-
onNativeAdLoadFailed
abstract Unit onNativeAdLoadFailed(String adUnitId, CloudXError error)
Native ad failed to load.
- Parameters:
adUnitId- The ad unit ID that failed to load.error- Details about the failure.
-
onNativeAdClicked
abstract Unit onNativeAdClicked(CloudXAd ad)
Native ad was clicked.
- Parameters:
ad- The ad that was clicked.
-
onNativeAdExpired
Unit onNativeAdExpired(CloudXAd ad)
Native ad has expired and should no longer be displayed. Destroy the ad and load a new one if needed.
Default no-op for backward compatibility — not all publishers need to handle expiration.
- Parameters:
ad- The expired ad.
-
onNativeAdClosed
Unit onNativeAdClosed(CloudXAd ad)
Called when the user closes/hides the native ad via AdChoices (e.g., reports or dismisses the ad).
The ad creative is invalidated after this fires — remove it from the UI and optionally load a replacement. In a feed context, advance to the next item.
Not all ad networks support this callback. Default no-op for backward compatibility.
- Parameters:
ad- The ad that was closed.
-
-
-
-