PALSession

interface PALSession

The Programmatic Access Libraries (PAL) are lightweight SDKs that provide discrete access to targeting signals for Google Ad Manager programmatic ads. The PAL SDK allows you to request a "nonce" from Google, to sign DVC requests. A "nonce" is a single encrypted string generated by PAL that should be added to ad requests as the value for the &paln URL parameter. Each new stream request must be accompanied by a newly generated nonce. However, same nonce can be reused for multiple ad requests within the same stream.

Nonce Manager:

--------------

The NonceManager manages the nonce for a single nonce request. This allows to update PAL when an impression or click event occurs.

Nonce Request:

--------------

The NonceRequest is used to store information about the request for a nonce. Once NonceRequest is built with PALConfiguration data NonceLoader is loaded with the NonceRequest, generates a encrypted String called nonce that can be added to ad requests as the value for the &paln URL parameter.

Functions

Link copied to clipboard
abstract suspend fun initialize(): Result<String, Error>

Handles PALSession initialization logic.

Link copied to clipboard
abstract fun onVideoViewTouch(motionEvent: MotionEvent)

Should be called on every touch interaction with the player.

Link copied to clipboard
abstract fun sendClick()

Should be called when the user clicks on the ad that was requested with the nonce generated by NonceManager.

Link copied to clipboard
abstract fun sendPlaybackEnd()

Should be called once user video playback session comes to an end.

Link copied to clipboard
abstract fun sendPlaybackStart()

Should be called once user video playback session begins.