AWSMobileAnalyticsMonetizationEventBuilder Class Reference

Inherits from NSObject
Declared in AWSMobileAnalyticsMonetizationEventBuilder.h
AWSMobileAnalyticsMonetizationEventBuilder.m

Overview

Base class for handling the required attributes and metrics for monetization Events. This class is not meant to be instantiated. Instead, create instances specific to the purchase you are trying to record. Currently, AWSMobileAnalyticsVirtualMonetizationEventBuilder is used to create monetization events for virtual purchases, and AWSMobileAnalyticsAppleMonetizationEventBuilder is used to create monetization events for purchases with Apple’s IAP framework.

This class can be extended if you need to record monetization events from other purchase frameworks. Derived classes must override the AWSMobileAnalyticsMonetizationEventBuilder::isValid method so that AWSMobileAnalyticsMonetizationEventBuilder knows if the derived builder is in a valid state.

– build

Builds an AWSMobileAnalyticsEvent using the current state of the builder.

- (id<AWSMobileAnalyticsEvent>)build

Return Value

an AWSMobileAnalyticsEvent or nil, if the builder is in an invalid state

Declared In

AWSMobileAnalyticsMonetizationEventBuilder.h

– isValid

Determines if this builder is in a valid state. This method must be overridden in derived classes.

- (BOOL)isValid

Return Value

YES if the Builder is valid, NO otherwise.

Declared In

AWSMobileAnalyticsMonetizationEventBuilder.h

– initWithEventClient:

Initializes the AWSMobileAnalyticsMonetizationEventBuilder. This class is not meant to be initialized directly. This method should only be called/overridden by derived builders.

- (id)initWithEventClient:(id<AWSMobileAnalyticsEventClient>)theEventClient

Declared In

AWSMobileAnalyticsMonetizationEventBuilder.h

– productId

The product id that will be used to build the monetization event

- (NSString *)productId

Return Value

The product id

Declared In

AWSMobileAnalyticsMonetizationEventBuilder.h

– setProductId:

Sets the product id to use when building the monetization event

- (void)setProductId:(NSString *)theProductId

Parameters

theProductId

the product id of the item being purchased

Declared In

AWSMobileAnalyticsMonetizationEventBuilder.h

– quantity

The quantity that will be used to build the monetization event

- (NSInteger)quantity

Return Value

The quantity of items purchased

Declared In

AWSMobileAnalyticsMonetizationEventBuilder.h

– setQuantity:

Sets the quantity to use when building the monetization event

- (void)setQuantity:(NSInteger)theQuantity

Parameters

theQuantity

the quantity of the item being purchased

Declared In

AWSMobileAnalyticsMonetizationEventBuilder.h

– itemPrice

The numerical price of the item being purchased that will be used to build the monetization event

- (double)itemPrice

Return Value

The numerical item price

Declared In

AWSMobileAnalyticsMonetizationEventBuilder.h

– setItemPrice:

Sets the numerical item price to use when building the monetization event

- (void)setItemPrice:(double)theItemPrice

Parameters

theItemPrice

the price of the item being purchased

Declared In

AWSMobileAnalyticsMonetizationEventBuilder.h

– formattedItemPrice

The formatted item price that will be used to build the monetization event

- (NSString *)formattedItemPrice

Return Value

The item price formatted with its currency

Declared In

AWSMobileAnalyticsMonetizationEventBuilder.h

– setFormattedItemPrice:

Sets the formatted item price in its local currency to use when building the monetization event

- (void)setFormattedItemPrice:(NSString *)theFormattedItemPrice

Parameters

theFormattedItemPrice

the formatted item price in its local currency

Declared In

AWSMobileAnalyticsMonetizationEventBuilder.h

– transactionId

The transaction id that will be used to build the monetization event

- (NSString *)transactionId

Return Value

The transaction id

Declared In

AWSMobileAnalyticsMonetizationEventBuilder.h

– setTransactionId:

Sets the transaction id to use when building the monetization event

- (void)setTransactionId:(NSString *)theTransactionId

Parameters

theTransactionId

the transaction id of the purchase

Declared In

AWSMobileAnalyticsMonetizationEventBuilder.h

– currency

The currency that be used to build the monetization event

- (NSString *)currency

Return Value

The currency

Declared In

AWSMobileAnalyticsMonetizationEventBuilder.h

– setCurrency:

Sets the currency of the item price to use when building the monetization event

- (void)setCurrency:(NSString *)theCurrency

Parameters

theCurrency

the ISO currency code or virtual curreny name of the item price

Declared In

AWSMobileAnalyticsMonetizationEventBuilder.h

– store

The name of the Store where this purchase was made. For example “Apple” for purchases originating from the Apple IAP Store, or “Virtual” if the purchase was performed in your in-game store.

- (NSString *)store

Return Value

The store of the purchase

Declared In

AWSMobileAnalyticsMonetizationEventBuilder.h

– setStore:

Sets the name of the Store to use when building the monetization event

- (void)setStore:(NSString *)theStore

Parameters

theStore

the store where the purchase originated from (i.e. “Apple” or “Virtual”)

Declared In

AWSMobileAnalyticsMonetizationEventBuilder.h