MPPromotionContainer Class Reference

Inherits from NSObject
Conforms to NSCopying
NSSecureCoding
Declared in MPPromotion.h

Overview

This class is a container for the information that represents a collection of promotions (one or more).

Usage:

Swift


let promotionContainer = MPPromotionContainer(action: MPPromotionAction.View, promotion: promotion1)

let commerceEvent = MPCommerceEvent(promotionContainer: promotionContainer)

let mParticle = MParticle.sharedInstance()

mParticle.logCommerceEvent(commerceEvent)

Objective-C


MPPromotionContainer *promotionContainer = [[MPPromotionContainer alloc] initWithAction:MPPromotionActionView promotion:promotion1];

MPCommerceEvent *commerceEvent = [[MPCommerceEvent alloc] initWithPromotionContainer:promotionContainer];

MParticle *mParticle = [MParticle sharedInstance];

[mParticle logCommerceEvent:commerceEvent];

  promotions

List of promotions under an action

@property (nonatomic, strong, readonly, nullable) NSArray<MPPromotion*> *promotions

Discussion

List of promotions under an action

Declared In

MPPromotion.h

  action

A value from the MPPromotionAction enum describing the promotion action.

@property (nonatomic, readonly) MPPromotionAction action

Discussion

A value from the MPPromotionAction enum describing the promotion action.

Declared In

MPPromotion.h

– initWithAction:promotion:

Initializes an instance of MPPromotionContainer with an action and a promotion.

- (nonnull instancetype)initWithAction:(MPPromotionAction)action promotion:(nullable MPPromotion *)promotion

Parameters

action

A value from the MPPromotionAction enum describing the promotion action

promotion

An instance of MPPromotion

Discussion

Initializes an instance of MPPromotionContainer with an action and a promotion.

Declared In

MPPromotion.h

– addPromotion:

Adds a promotion to the list of promotions to have action applied to.

- (void)addPromotion:(nonnull MPPromotion *)promotion

Parameters

promotion

An instance of MPPromotion

Discussion

Adds a promotion to the list of promotions to have action applied to.

Declared In

MPPromotion.h