com.annahid.libs.artenus.unified
Product
Represents a product in an in-app billing system.
public final class Product
Field Summary
Modifier and Type | Field and Description |
---|---|
public static | CONSUMABLE Indicates a product that can be purchased multiple times by a customer. |
public static | ENTITLEMENT Indicates any type of content that you sell within your game that requires an access rights. |
public static | SUBSCRIPTION Indicates a product with recurring, automated billing at the interval you specify. |
Constructor Summary
Modifier and Type | Constructor and Description |
---|---|
public | Product(String sku, String title, String desc, String price, int type) Creates a new instance of Product with the specified information. |
Method Summary
Modifier and Type | Method and Description |
---|---|
public boolean | equals(Object obj) Indicates whether some other object is equal to this one. |
public String | getDescription() Gets the description of this product. |
public String | getPrice() Gets the price of this product. |
public int | getProductType() Gets the type of this product. |
public ProductReceipt | getReceipt() Gets the product receipt. |
public String | getSKU() Gets this product's SKU (unique stock-keeping unit identifier). |
public String | getTitle() Gets the title of this product. |
public void | setReceipt(ProductReceipt receipt) This method is called internally during a purchase flow, to assign a receipt to this product. |
Methods inherited from java.lang.Object
clone
, equals
, finalize
, getClass
, hashCode
, notify
, notifyAll
, toString
, wait
, wait
, wait
Field Detail
CONSUMABLE |
---|
public static CONSUMABLE Indicates a product that can be purchased multiple times by a customer. Examples include
fuel and ammo. |
ENTITLEMENT |
---|
public static ENTITLEMENT Indicates any type of content that you sell within your game that requires an access rights.
Examples include additional levels for a game, unlocking functionality already in your app,
etc. This product type is not supported by all app-stores. It is recommended to use
subscriptions instead, unless you only target specific app-stores with support for
entitlements. |
SUBSCRIPTION |
---|
public static SUBSCRIPTION Indicates a product with recurring, automated billing at the interval you specify. Examples
of this product type in games include premium version (extra features), removed
ads, etc. |
Constructor Detail
Product | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
public Product( String sku, String title, String desc, String price, int type )Creates a new instance of Product with the specified information. Parameters:
|
Method Detail
equals | ||
---|---|---|
public boolean equals( Object obj ) Indicates whether some other object is equal to this one. Equality in the context of
products is closely related to equal SKUs, hence that's what is compared by this method. Parameters:
Returns:
true if obj is a product with the same SKU as this instance,
false otherwise. |
getDescription |
---|
public String getDescription() Gets the description of this product. Returns:
The description |
getPrice |
---|
public String getPrice() Gets the price of this product. Returns:
Price string, including the currency |
getProductType |
---|
public int getProductType() Returns:
Product type |
getReceipt |
---|
public ProductReceipt getReceipt() Gets the product receipt. A product has a receipt if it has been acquired by the user. The
receipt contains purchase information. Returns:
Product receipt, or null if there is no purchase See Also:
|
getSKU |
---|
public String getSKU() Gets this product's SKU (unique stock-keeping unit identifier). Returns:
Product SKU as specified in the app-store |
getTitle |
---|
public String getTitle() Gets the title of this product. Returns:
The title |
setReceipt | ||
---|---|---|
public void setReceipt( ProductReceipt receipt ) This method is called internally during a purchase flow, to assign a receipt to this product. Parameters:
See Also:
|