@Deprecated public class AmazonMonetizationEventBuilder extends MonetizationEventBuilder
// get the event client from your MobileAnalyticsManager instance EventClient eventClient = mobileAnalyticsManager.getEventClient(); // create a builder that can record purchase events for Amazon IAP AmazonMonetizationEventBuilder builder = AmazonMonetizationEventBuilder.create(eventClient); // build the monetization event with the product id, formatted item price, and // quantity // product id and formatted item price are obtained from the Item object // Amazon IAP currently only supports a quantity of 1 Event purchaseEvent = builder.withProductId(purchasedItem.getSku()) .withFormattedItemPrice(purchasedItem.getPrice()).withQuantity(1).build(); // record the monetization event eventClient.recordEvent(purchaseEvent);
Modifier and Type | Method and Description |
---|---|
static AmazonMonetizationEventBuilder |
create(EventClient eventClient)
Deprecated.
Create a AmazonMonetizationEventBuilder with the specified Event client
|
AmazonMonetizationEventBuilder |
withFormattedItemPrice(java.lang.String formattedItemPrice)
Deprecated.
Sets the formatted localized price of the item being purchased (accessed
from the getPrice() method of the Item class).
|
AmazonMonetizationEventBuilder |
withProductId(java.lang.String productId)
Deprecated.
Sets the product identifier field of the item being purchased
|
AmazonMonetizationEventBuilder |
withQuantity(java.lang.Double quantity)
Deprecated.
Sets the quantity of the item being purchased.
|
build
public static AmazonMonetizationEventBuilder create(EventClient eventClient)
eventClient
- The event client to use when creating monetization
eventspublic AmazonMonetizationEventBuilder withProductId(java.lang.String productId)
productId
- The product id representing the item being purchasedpublic AmazonMonetizationEventBuilder withFormattedItemPrice(java.lang.String formattedItemPrice)
formattedItemPrice
- The localized formatted price of the itempublic AmazonMonetizationEventBuilder withQuantity(java.lang.Double quantity)
quantity
- Currently, Amazon IAP only supports purchasing 1 item at
a time.Copyright © 2018 Amazon Web Services, Inc. All Rights Reserved.