MMInlineAd Class Reference

Inherits from MMAd : NSObject
Declared in MMInlineAd.h

Overview

The class representing an “inline” advertisment. Inline ads consist of ads which are meant to be displayed alongside other, native content, such as banners or other inserted views.

– initWithPlacementId:adSize:

Initializes an inline placement. This method must be invoked from the main thread.

- (nullable instancetype)initWithPlacementId:(NSString *)placementId adSize:(MMInlineAdSize)adSize

Parameters

placementId

The ad’s placement ID.

adSize

The size of the banner to request.

Discussion

Initializes an inline placement. This method must be invoked from the main thread.

Declared In

MMInlineAd.h

– initWithPlacementId:size:

Initializes an inline placement with an explicitly defined size. This method must be invoked from the main thread.

- (nullable instancetype)initWithPlacementId:(NSString *)placementId size:(CGSize)freeformSize

Parameters

placementId

The ad’s placement ID.

freeformSize

The explicit size of the placement to request.

Discussion

Initializes an inline placement with an explicitly defined size. This method must be invoked from the main thread.

Declared In

MMInlineAd.h

+ minimumRefreshInterval

The minimum refresh interval, in seconds, for the ad.

+ (NSTimeInterval)minimumRefreshInterval

Discussion

The minimum refresh interval, in seconds, for the ad.

The refreshInterval may not be set to a value less than the minimumRefreshInterval.

Declared In

MMInlineAd.h

– request:

Requests an ad, asynchronously, using information supplied in the mmAdRequest dictionary.

- (void)request:(nullable MMRequestInfo *)requestInfo

Parameters

requestInfo

Additional targeting information relevant to this individual request. This value may be nil.

Discussion

Requests an ad, asynchronously, using information supplied in the mmAdRequest dictionary.

If no refreshInterval has been set, a single, non-refreshing ad request will be made. If there is a positive refreshInterval, ads will automatically refresh using the interval.

Declared In

MMInlineAd.h

– abort

Attempts to cancel a currently pending request.

- (void)abort

Discussion

Attempts to cancel a currently pending request.

Note that there is not a guarantee that this method will result in canceling a pending request, or that a request may be canceled for a reason other than a user-initiated abort.

Additonally, in certain timing-dependent multithread scenarios, an abort may be requested ‘too late’. This would be where a request has succeeded/failed and is being processed on the appropriate thread, while a different thread requests an ‘abort’. In this case the abort message is ignored and none of the abort callbacks are invoked.

See the documentation for inlineAd:abortDidFailWithError: for details on how this method affects callbacks.

Declared In

MMInlineAd.h

  view

The view containing the ad. This view should not have its subviews modified, or be styled, in any way.

@property (nonatomic, readonly) UIView *view

Discussion

The view containing the ad. This view should not have its subviews modified, or be styled, in any way.

The MMInlineAd view’s bounds are specificed by the size passed in via the constructor.

Declared In

MMInlineAd.h

  refreshInterval

The auto-refresh interval for the ad, in seconds. Auto-refreshing is disabled by default.

@property (nonatomic, assign) NSTimeInterval refreshInterval

Discussion

The auto-refresh interval for the ad, in seconds. Auto-refreshing is disabled by default.

Setting refreshInterval to a positive value starts auto-refresh for subsequent requests. If the value is already non-zero, the new value takes precedence after the next request.

If set to a (positive) value lower than the minimumRefreshInterval, the minimumRefreshInterval is used.

Refresh behavior is automatically disabled when a view is not visible onscreen or while the app is suspended, and automatically resumes when the view becomes visible or the app becomes active.

Setting the MMInlineDisableRefresh value disables refresh behavior.

Declared In

MMInlineAd.h

  flexibleBackgroundColor

The background color for requested space not filled by the ads.

@property (nonatomic, readwrite) UIColor *flexibleBackgroundColor

Discussion

The background color for requested space not filled by the ads.

If this value is not set, it defaults to [UIColor clearColor].

Declared In

MMInlineAd.h

  modalTransitionStyle

The transition style for modal presentation of views presented by this inline ad.

@property (assign, nonatomic) UIModalTransitionStyle modalTransitionStyle

Discussion

The transition style for modal presentation of views presented by this inline ad.

The default value is UIModalTransitionStyleCoverVertical. UIModalTransitionStylePartialCurl is not supported and will instead set the default value.

Declared In

MMInlineAd.h

  delegate

The inline’s delegate.

@property (nonatomic, weak, nullable) id<MMInlineDelegate> delegate

Discussion

The inline’s delegate.

Declared In

MMInlineAd.h

  size

The size of the currently retrieved ad. If no ad has been retrieved this value is CGSizeZero.

@property (nonatomic, readonly) CGSize size

Discussion

The size of the currently retrieved ad. If no ad has been retrieved this value is CGSizeZero.

Note that this value may differ from requestedSize.

Declared In

MMInlineAd.h

  requestedSize

The size which any ads will be requested to fit.

@property (nonatomic, readonly) CGSize requestedSize

Discussion

The size which any ads will be requested to fit.

This value is based on the size (or size constant) used at the time of initialization. In the case of MMInlineAdSizeFlexible, it is the largest size which could be filled with a complete ad.

Declared In

MMInlineAd.h