PictureInPictureAdEventCallback

@ExperimentalApi
public interface PictureInPictureAdEventCallback extends AdEventCallback


Callback for receiving ad events during the lifecycle of a Picture-in-Picture ad.

This interface extends AdEventCallback and OnAppEventListener to provide standard ad events (such as clicks and impressions) alongside picture-in-picture specific visibility events such as the ad being shown or hidden.

Summary

Public methods

default void

Called when the picture-in-picture ad is removed from the screen.

default void

Called when the picture-in-picture ad is displayed on the screen.

default void

Called when an app event occurs.

Inherited methods

From com.google.android.libraries.ads.mobile.sdk.common.AdEventCallback
default void

Called when a click is recorded for an ad.

default void

Called when the ad dismisses an overlay that it previously showed.

default void

Called when the ad fails to show fullscreen content.

default void

Called when an impression is recorded for an ad.

default void

Called when an ad is estimated to have earned money.

default void

Called when an ad opens an overlay that covers the screen, for example an MRAID expanded ad, ad choices overlay, or a full screen ad.

Public methods

onAdHidden

default void onAdHidden()

Called when the picture-in-picture ad is removed from the screen. This can occur if the user manually dismisses the ad or if it is programmatically hidden with PictureInPictureAd.hide.

onAdShown

default void onAdShown()

Called when the picture-in-picture ad is displayed on the screen.

onAppEvent

default void onAppEvent(@NonNull String name, String data)

Called when an app event occurs.

App events allow JavaScript within an ad to trigger events in the application. The ad can trigger the app event with a name and optional data. It is then up to the application to decide how to handle the event.

This feature is only available for Ad Manager publishers.

Parameters
@NonNull String name

The name of the app event.

String data

Extra data included with the app event. The data can be null.