GoogleMobileAds (Beta) Framework Reference

GADSqueezebackAd


@interface GADSqueezebackAd : NSObject

A squeezeback ad shrinks the app’s content and shows an ad in the space around it.

  • The unique identifier assigned to a specific ad placement in an app, created on the AdMob or Ad Manager UI.

    Declaration

    Swift

    var adUnitID: String { get }

    Objective-C

    @property (nonatomic, readonly, nonnull) NSString *adUnitID;
  • Information about the ad response that returned the ad.

    Declaration

    Swift

    var responseInfo: ResponseInfo { get }

    Objective-C

    @property (nonatomic, readonly, nonnull) GADResponseInfo *responseInfo;
  • Optional delegate to receive presentation, lifecycle, and interaction events.

    Declaration

    Swift

    weak var delegate: (any SqueezebackAdDelegate)? { get set }

    Objective-C

    @property (nonatomic, weak, nullable) id<GADSqueezebackAdDelegate> delegate;
  • Unavailable

    Unavailable. Use +loadWithAdUnitID:request:completionHandler: instead.

    Declaration

    Objective-C

    - (nonnull instancetype)init;
  • Loads a squeezeback ad.

    Declaration

    Swift

    class func load(with adUnitID: String, request: Request?) async throws -> sending SqueezebackAd

    Objective-C

    + (void)loadWithAdUnitID:(nonnull NSString *)adUnitID
                     request:(nullable GADRequest *)request
           completionHandler:
               (nonnull GADSqueezebackAdLoadCompletionHandler)completionHandler;

    Parameters

    adUnitID

    An ad unit ID created in the AdMob or Ad Manager UI.

    request

    An ad request object. If nil, a default ad request object is used.

    completionHandler

    A handler to execute when the load operation finishes or times out.

  • Shows the squeezeback ad on the screen. Must be called on the main thread.

    Declaration

    Swift

    @MainActor func show(with options: SqueezebackAdOptions)

    Objective-C

    - (void)showWithOptions:(nonnull GADSqueezebackAdOptions *)options;

    Parameters

    options

    The options specifying presentation behavior.

  • Hides the squeezeback ad and restores the app’s content to its original size. Must be called on the main thread.

    Declaration

    Swift

    @MainActor func hide()

    Objective-C

    - (void)hide;