AWSMobileAnalyticsVirtualMonetizationEventBuilder Class Reference

Inherits from AWSMobileAnalyticsMonetizationEventBuilder : NSObject
Declared in AWSMobileAnalyticsVirtualMonetizationEventBuilder.h
AWSMobileAnalyticsVirtualMonetizationEventBuilder.m

Overview

AWSMobileAnalyticsVirtualMonetizationEventBuilder builds monetization events to track virtual purchases from your In-Game store. In order to build a Virtual monetization event, you must call all of the setters on this builder.

The example below shows how to record a monetization event for the purchase of 1 sword that costs 500 Gold.

 idAWSMobileAnalyticsEventClient eventClient = insights.eventClient;

 // create a builder that can record purchase events from your In-Game Store
 AWSMobileAnalyticsVirtualMonetizationEventBuilder* builder = [AWSMobileAnalyticsVirtualMonetizationEventBuilder builderWithEventClient:eventClient];

 // set the product id of the purchased item
 [builder withProductId:@"com.yourgame.sword"];

 // set the item price
 [builder withItemPrice:500];

 // set the currency of the item price
 [builder withCurrency:@"Gold"];

 // set the quantity of item(s) purchased
 [builder withQuantity:1];

 // build/record the monetization event
 idAWSMobileAnalyticsEvent virtualPurchaseEvent = [builder build];
 [eventClient recordEvent:virtualPurchaseEvent];

Other Methods

+ builderWithEventClient:

Create a monetization builder that can record purchase events from your In-Game Store

+ (AWSMobileAnalyticsVirtualMonetizationEventBuilder *)builderWithEventClient:(id<AWSMobileAnalyticsEventClient>)theEventClient

Parameters

theEventClient

The event client used to create the event

Return Value

a monetization event builder for In-Game store purchases

Declared In

AWSMobileAnalyticsVirtualMonetizationEventBuilder.h

– withProductId:

Sets the product id for the item(s) being purchased

- (void)withProductId:(NSString *)theProductId

Parameters

theProductId

The product id of the item(s) being purchased

Declared In

AWSMobileAnalyticsVirtualMonetizationEventBuilder.h

– withItemPrice:

Sets the item price of the item being purchased

- (void)withItemPrice:(double)theItemPrice

Parameters

theItemPrice

The numerical item price

Declared In

AWSMobileAnalyticsVirtualMonetizationEventBuilder.h

– withQuantity:

Sets the quantity of item(s) being purchased.

- (void)withQuantity:(NSInteger)theQuantity

Parameters

theQuantity

The quantity of items purchased

Declared In

AWSMobileAnalyticsVirtualMonetizationEventBuilder.h

– withCurrency:

Sets the currency of the item price

- (void)withCurrency:(NSString *)theCurrency

Parameters

theCurrency

The currency of the item price

Declared In

AWSMobileAnalyticsVirtualMonetizationEventBuilder.h

– build

Builds the monetization event using the parameters set on the builder. You must still record the event.

- (id<AWSMobileAnalyticsEvent>)build

Return Value

an AWSMobileAnalyticsEvent to record

Declared In

AWSMobileAnalyticsVirtualMonetizationEventBuilder.h

Other Methods

– initWithEventClient:

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

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

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