|
|||||||
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.AmazonMonetizationEventBuilder
public class AmazonMonetizationEventBuilder
Builds monetization events representing an Amazon purchase. This Builder automatically sets the store attribute to "Amazon". This Builder will return null if the ProductId, Formatted Localized Price, or Quantity are not set.
Example:// 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);
Method Summary | |
---|---|
static AmazonMonetizationEventBuilder |
create(EventClient eventClient)
Create a AmazonMonetizationEventBuilder with the specified Event client |
AmazonMonetizationEventBuilder |
withFormattedItemPrice(java.lang.String formattedItemPrice)
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)
Sets the product identifier field of the item being purchased |
AmazonMonetizationEventBuilder |
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 AmazonMonetizationEventBuilder create(EventClient eventClient)
eventClient
- The event client to use when creating monetization events
public AmazonMonetizationEventBuilder withProductId(java.lang.String productId)
productId
- The product id representing the item being purchased
public AmazonMonetizationEventBuilder withFormattedItemPrice(java.lang.String formattedItemPrice)
formattedItemPrice
- The localized formatted price of the item
public AmazonMonetizationEventBuilder withQuantity(java.lang.Double quantity)
quantity
- Currently, Amazon IAP only supports purchasing 1 item at a
time.
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |