# ProgrammaticAccessLibrary Framework Reference

# PALNonceManager


    @interface PALNonceManager : NSObject

Manages a nonce and its event reporting for a single content playback session.

The below content playback session lifecycle methods must be accurately called in order to enable
programmatic monetization.
- `


  ### [nonce](https://developers.google.com/ad-manager/pal/ios/reference/Classes/PALNonceManager#/c:objc(cs)PALNonceManager(py)nonce)


  ` The nonce generated for this manager when it was loaded.

  This value will never change for a given `PALNonceManager` instance.
  This nonce value is only valid for a single content playback session up to a maximum duration of
  6 hours.

  #### Declaration

  Swift

      var nonce: String { get }

  Objective-C

      @property (nonatomic, copy, readonly, nonnull) NSString *nonce;

- `


  ### [gestureRecognizer](https://developers.google.com/ad-manager/pal/ios/reference/Classes/PALNonceManager#/c:objc(cs)PALNonceManager(py)gestureRecognizer)


  ` A gesture recognizer that must be attached to each view each ad is displayed in during playback.

  Attach this gesture recognizer through `UIView`'s `addGestureRecognizer`:
  method. Once the ad is complete, the gesture recognizer may be removed with
  `removeGestureRecognizer`: and added to another one if the view is not the same.
  This recognizer does not trigger any network requests.

  #### Declaration

  Swift

      var gestureRecognizer: UIGestureRecognizer { get }

  Objective-C

      @property (nonatomic, readonly, nonnull) UIGestureRecognizer *gestureRecognizer;

- `


  ### [-sendAdClick](https://developers.google.com/ad-manager/pal/ios/reference/Classes/PALNonceManager#/c:objc(cs)PALNonceManager(im)sendAdClick)


  ` Notifies Google ad servers that a clickthrough on an ad has occurred during the given content
  playback session.

  #### Declaration

  Swift

      func sendAdClick()

  Objective-C

      - (void)sendAdClick;

- `


  ### [-sendPlaybackStart](https://developers.google.com/ad-manager/pal/ios/reference/Classes/PALNonceManager#/c:objc(cs)PALNonceManager(im)sendPlaybackStart)


  ` Notifies Google ad servers that playback for the given content playback session has started. This
  should be called on "video player start". This may be in response to a user-initiated action
  (click-to-play) or an app initiated action (autoplay).

  This method will start asynchronous calls to Google servers to collect signals needed for IVT
  monitoring and detection.

  #### Declaration

  Swift

      func sendPlaybackStart()

  Objective-C

      - (void)sendPlaybackStart;

- `


  ### [-sendPlaybackEnd](https://developers.google.com/ad-manager/pal/ios/reference/Classes/PALNonceManager#/c:objc(cs)PALNonceManager(im)sendPlaybackEnd)


  ` Notifies Google ad servers that playback for the given content playback session has ended. This
  should be called when playback ends (for example, when the player reaches end of stream, or when
  the user exits playback mid-way, or when the user quits the app).

  This method ends the asynchronous calls to Google servers started in `sendPlaybackStart`.

  #### Declaration

  Swift

      func sendPlaybackEnd()

  Objective-C

      - (void)sendPlaybackEnd;