public class VirtualMonetizationEventBuilder extends MonetizationEventBuilder
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);
Modifier and Type | Method and Description |
---|---|
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.
|
build
public static VirtualMonetizationEventBuilder create(EventClient eventClient)
eventClient
- The event client to use when creating monetization
eventspublic VirtualMonetizationEventBuilder withProductId(java.lang.String productId)
productId
- The product id representing the item being purchasedpublic VirtualMonetizationEventBuilder withItemPrice(double itemPrice)
itemPrice
- The numerical price of the itempublic VirtualMonetizationEventBuilder withQuantity(java.lang.Double quantity)
quantity
- The number of items purchased in this transactionpublic VirtualMonetizationEventBuilder withCurrency(java.lang.String currency)
currency
- The name of the virtual currency used to purchase this
item (i.e. Coins or Gold)Copyright © 2010 Amazon Web Services, Inc. All Rights Reserved.