Ads

@interface Ads : NSObject

Ads library

  • Singleton instance

    Declaration

    Swift

    + (nonnull Ads *)sharedInstance;
  • Call this method when you want to show an ad. The delegate will receive view callbacks.

    Declaration

    Swift

    + (void)showAd:(nonnull NSString *)placement
     onViewController:(nonnull UIViewController *)viewController;

    Parameters

    placement

    This identifying placement string may be used to control how often the ad is shown to the user.

    viewController

    The app’s view controller on which to push an ad view onto.

  • Check the readiness of an ad. Useful for enabling user opt-in-to-watch-ad features.

    Declaration

    Swift

    + (BOOL)isAdReady;

    Return Value

    Whether or not the ad is ready.

  • Check if an ad is or will be showing. Useful for preventing overlapping native views

    Declaration

    Swift

    + (BOOL)isAdShowing;

    Return Value

    Whether or not the ad is ready.

  • Call this method when you want to show a rewarded video ad. The delegate will receive view callbacks.

    Declaration

    Swift

    + (void)showRewardedVideoAd:(nonnull NSString *)placement
     onViewController:(nonnull UIViewController *)viewController;

    Parameters

    placement

    This identifying placement string may be used to control how often the ad is shown to the user.

    viewController

    The app’s view controller on which to push an ad view onto.

  • Check the readiness of a rewarded video ad.

    Declaration

    Swift

    + (BOOL)isRewardedVideoAdReady;

    Return Value

    Whether or not the ad is ready.

  • Set a delegate for receiving callbacks about the status of the ad.

    Declaration

    Swift

    + (void)setDelegate:(nullable id<AdsDelegate>)delegate;

    Parameters

    delegate

    A conforming class for receiving callbacks.

  • Used to disable an ad network for this session, overriding what is set in the Manifest.

    Declaration

    Swift

    + (void)setAdNetwork:(nonnull NSString *)adNetworkName enabled:(BOOL)isEnabled;

    Parameters

    adNetworkName

    The name of the ad network as it appears in the Manifest

    isEnabled

    Whether or not to set this network as enabled or disabled

  • Returns the current remaining inverval for a given placement.

    Note

    only used for placements with the type IMPRESSIONS

    Declaration

    Swift

    + (int)remainingAttemptsForPlacement:(nonnull NSString *)placementID;

    Parameters

    placementID

    The placement to query

  • True only when this system has been initialized

    Declaration

    Swift

    - (BOOL)isInitialized;
  • Creates and activates an instance of this system.

    Declaration

    Swift

    - (void)initializeSystem;