# Interface AdSessionCallback

public interface AdSessionCallback

The callback a `AdProvider` uses to report ad lifecycle events back to the Codename One ads layer. Providers may invoke these methods from any thread; the ads layer marshals them onto the EDT before forwarding to the public `AdListener`.

This is an internal SPI type; applications use `AdListener`.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `onClicked()`
  The ad was clicked.
  `void`
  `onDismissed()`
  The ad was dismissed.
  `void`
  `onFailedToLoad(AdError error)`
  The ad failed to load.
  `void`
  `onImpression()`
  An impression was recorded.
  `void`
  `onLoaded()`
  The ad finished loading.
  `void`
  `onShowFailed(AdError error)`
  The ad failed to present.
  `void`
  `onShown()`
  The ad was presented.
  `void`
  `onUserEarnedReward(RewardItem reward)`
  The user earned a reward (rewarded formats only).

- ## Method Details

  - ### onLoaded

    void onLoaded()
    The ad finished loading.

  - ### onFailedToLoad

    void onFailedToLoad(AdError error)
    The ad failed to load.

  - ### onShown

    void onShown()
    The ad was presented.

  - ### onShowFailed

    void onShowFailed(AdError error)
    The ad failed to present.

  - ### onDismissed

    void onDismissed()
    The ad was dismissed.

  - ### onImpression

    void onImpression()
    An impression was recorded.

  - ### onClicked

    void onClicked()
    The ad was clicked.

  - ### onUserEarnedReward

    void onUserEarnedReward(RewardItem reward)
    The user earned a reward (rewarded formats only).