|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.amazonaws.mobileconnectors.amazonmobileanalytics.monetization.MonetizationEventBuilder
com.amazonaws.mobileconnectors.amazonmobileanalytics.monetization.VirtualMonetizationEventBuilder
public class VirtualMonetizationEventBuilder
Builds monetization events representing a purchase from a Virtual or In-Game store. This Builder automatically sets the store attribute to "Virtual". This Builder will return null if the ProductId, Price, Currency, or Quantity are not set.
The example below shows how to record a monetization event for the purchase of 1 sword that costs 500 Gold.
Example:// get the event client from your MobileAnalyticsManager instance EventClient eventClient = mobileAnalyticsManager.getEventClient(); // create a builder that can record purchase events for a Virtual In Game Store VirtualMonetizationEventBuilder builder = VirtualMonetizationEventBuilder.create(eventClient); // build the monetization event with the product id, item price, currency type, and quantity Event purchaseEvent = builder.withProductId("com.yourgame.sword").withItemPrice(500).withCurrency("Gold").withQuantity(1).build(); // record the monetization event eventClient.recordEvent(purchaseEvent);
Method Summary | |
---|---|
static VirtualMonetizationEventBuilder |
create(EventClient eventClient)
Create a VirtualMonetizationEventBuilder with the specified Event client |
VirtualMonetizationEventBuilder |
withCurrency(java.lang.String currency)
Sets the currency of the item being purchased. |
VirtualMonetizationEventBuilder |
withItemPrice(double itemPrice)
Sets the numerical price of the item being purchased |
VirtualMonetizationEventBuilder |
withProductId(java.lang.String productId)
Sets the product identifier field of the item being purchased. |
VirtualMonetizationEventBuilder |
withQuantity(java.lang.Double quantity)
Sets the quantity of the item being purchased. |
Methods inherited from class com.amazonaws.mobileconnectors.amazonmobileanalytics.monetization.MonetizationEventBuilder |
---|
build |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static VirtualMonetizationEventBuilder create(EventClient eventClient)
eventClient
- The event client to use when creating monetization events
public VirtualMonetizationEventBuilder withProductId(java.lang.String productId)
productId
- The product id representing the item being purchased
public VirtualMonetizationEventBuilder withItemPrice(double itemPrice)
itemPrice
- The numerical price of the item
public VirtualMonetizationEventBuilder withQuantity(java.lang.Double quantity)
quantity
- The number of items purchased in this transaction
public VirtualMonetizationEventBuilder withCurrency(java.lang.String currency)
currency
- The name of the virtual currency used to purchase this item
(i.e. Coins or Gold)
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |