MPClientAdPositioning /5.0.0

@interface MPClientAdPositioning : MPAdPositioning

The MPClientAdPositioning class is a model that allows you to control the positions where native advertisements should appear within a stream. A positioning object works in conjunction with an ad placer, giving the ad placer the information it needs to configure the positions and frequency of ads. You can specify that ads should appear at fixed index paths and/or at equally spaced intervals throughout your content.

Unlike with MPServerAdPositioning, which tells an ad placer to obtain its positioning information from the MoPub ad server, client ad positioning does not allow you to control your ad positions via the MoPub website.

Public Methods

Creating a Client Positioning Object

+/positioning /+5.0.0

  • Description: Creates and returns an empty positioning object. In order for ads to display in a stream, the positioning object must either have at least one fixed position or have repeating positions enabled.

  • Declaration:

    + (instancetype)positioning;
  • Parameters: None.

-/addFixedIndexPath: /+5.0.0

  • Description: Tells the positioning object that an ad should be placed at the specified position. Positions are passed in as absolute index paths within a stream. For example, if you place an ad in a table view at a fixed index path with row 1, an ad will appear in row 1, which may shift other content items to higher row indexes. Note that this method uses NSIndexPath objects to accommodate streams with multiple sections. If your stream does not contain multiple sections, you should pass in index paths with a section value of ‘0’.

  • Declaration:

    - (void)addFixedIndexPath:(NSIndexPath *)indexPath;
  • Parameters:

    • indexPath: An index path representing a position for an ad.

-/enableRepeatingPositionsWithInterval: /+5.0.0

  • Description: Tells the positioning object that ads should be displayed evenly throughout a stream using the specified interval. Repeating ads will only appear within a single section. If the receiver has fixed positions, the sequence of repeating ads will start to appear following the last registered fixed position. If the receiver does not have any fixed positions, ads will appear regularly starting at interval, within the first section.

  • Declaration:

    - (void)enableRepeatingPositionsWithInterval:(NSUInteger)interval;
  • Parameters:

    • interval: The frequency at which to display ads. This must be a value greater than 1.

Last updated March 30, 2021

TWITTER, MOPUB, and the Bird logo are trademarks of Twitter, Inc. or its affiliates. All third party logos and trademarks included are the property of their respective owners.

© 2021 MoPub (a division of Twitter, Inc.)