react-native-google-mobile-ads
    Preparing search index...

    Type Alias AdExpiry

    Publisher-owned staleness policy on inventory the consumer holds.

    Protects against the library or the publisher holding an ad too long. It does not certify that an ad inside the window is valid: on an SDK-managed poll the ad may already be past the platform's own timeout at hand-off.

    Scope still matters: these members describe the object the consumer holds. Pool churn events describe pool-owned inventory only, and a handed-out ad has already left the pool, so those events can never identify it.

    type AdExpiry = {
        stalenessWindowMillis: number;
        stalenessWindowSource: AdStalenessWindowSource;
        isStaleByPolicy(): boolean;
        onStaleByPolicy(listener: () => void): () => void;
    }
    Index
    • True once observedAt is non-null and older than stalenessWindowMillis. When observedAt is null, returns false (unknown age is not treated as stale by policy; the publisher still decides whether to show).

      A false result is not a validity certificate.

      Returns boolean

    • Fires when the held ad crosses the applied policy window. Returns an unsubscribe function.

      Edge semantics:

      • Subscribing when already stale by policy invokes the listener synchronously once.
      • When observedAt is null, isStaleByPolicy() is false and this subscription never fires (unknown age is not treated as stale).
      • destroy() releases listeners; a later unsubscribe is a no-op.
      • The timer lives on this object, not on the pool or the hook, so it keeps running after release() transfers ownership to the caller and after pool destroy(). Pool teardown does not own or cancel this timer.

      Parameters

      • listener: () => void

      Returns () => void

    stalenessWindowMillis: number

    Applied staleness window in milliseconds. Either the publisher's configured value or the guidance default for the format.

    stalenessWindowSource: AdStalenessWindowSource

    Whether the applied window was configured or inherited from guidance.