RevenueInfo class
The class contains immutable information about the revenue from in-app purchases.
Use the MutableRevenueInfo class to change information about revenue.
The instance of the RevenueInfo
class should be sent to the AppMetrica server using the reportRevenue method of the AppMetrica class.
Instance methods
Initializes the instance of the |
|
init(priceDecimal:currency:quantity:productID:transactionID:receiptData:payload:) |
Initializes the instance of the |
Properties
Currency code of the purchase in ISO 4217 format. |
|
Additional information to be passed about the purchase. |
|
Price. It can be negative, e.g. for refunds. |
|
The price that is set using the NSDecimalNumber object. It can be negative, e.g. for refunds. |
|
ID of the product purchased. The value can contain up to 200 characters. |
|
Quantity of products purchased. |
|
Details about the in-app purchase order from App Store. |
|
Details about the in-app purchase order from App Store. |
Method descriptions
init(priceDecimal:currency:)
init(priceDecimal: NSDecimalNumber, currency: String)
Initializes the instance of the RevenueInfo
class for sending information about purchases.
Parameters:
|
The price that is set using the NSDecimalNumber instance. It can be negative, e.g. for refunds. |
|
Currency code of the purchase in ISO 4217 format. The value should contain 3 Latin letters in uppercase. Example: Note If the value is not in the ISO 4217 format, the purchase is ignored. |
Returns:
The RevenueInfo
class instance.
init(priceDecimal:currency:quantity:productID:transactionID:receiptData:payload:)
init(priceDecimal: NSDecimalNumber, currency: String, quantity: UInt, productID: String?, transactionID: String?, receiptData: Data?, payload: [AnyHashable : Any]?)
Initializes the instance of the RevenueInfo
class for sending information about purchases.
Parameters:
|
The price that is set using the NSDecimalNumber instance. It can be negative, e.g. for refunds. |
|
Currency code of the purchase in ISO 4217 format. The value should contain 3 Latin letters in uppercase. Example: Note If the value is not in ISO 4217 format, the purchase is ignored. |
|
Quantity of products purchased. |
|
ID of the product purchased. The value can contain up to 200 characters. |
|
Details about the in-app purchase order from App Store. |
|
Details about the in-app purchase order from App Store. |
|
Additional information to be passed about the purchase. For instance, it can be used for categorizing your products. You must pass the |
Returns:
The RevenueInfo
class instance.
Property descriptions
currency
var currency: String { get }
Currency code of the purchase in ISO 4217 format. The value should contain 3 Latin letters in uppercase. Example: RUB
.
Note
If the value is not in the ISO 4217 format, the purchase is ignored.
payload
var payload: [AnyHashable : Any]? { get }
Additional information to be passed about the purchase. For instance, it can be used for categorizing your products.
You must pass the AnyHashable
object that can be converted to a valid JSON. The maximum size of the value is 30 KB.
price
priceDecimal
var priceDecimal: NSDecimalNumber? { get }
The price that is set using the NSDecimalNumber instance. It can be negative, e.g. for refunds.
productID
var productID: String? { get }
ID of the product purchased. The value can contain up to 200 characters.
quantity
var quantity: UInt { get }
Quantity of products purchased.
receiptData
var receiptData: Data? { get }
Details about the in-app purchase order from App Store.
transactionID
var transactionID: String? { get }
Details about the in-app purchase order from App Store.