YMMRevenueInfo class
The class contains immutable information about the revenue from in-app purchases.
Use the YMMMutableRevenueInfo class to change information about revenue.
The instance of the YMMRevenueInfo
class should be sent to the AppMetrica server using the reportRevenue
method of the YMMYandexMetrica
class.
Instance methods
init(price:currency:) | Initializes the instance of the Attention. Deprecated method. Use the init!(priceDecimal:currency:) method instead. |
init(priceDecimal:currency:) | Initializes the instance of the |
init(price:currency:quantity:productID:transactionID:receiptData:payload:) | Initializes the instance of the Attention. Deprecated method. Use the init!(priceDecimal:currency:quantity:productID:transactionID:receiptData:payload:) method instead. |
init(priceDecimal:currency:quantity:productID:transactionID:receiptData:payload:) | Initializes the instance of the |
init(price:currency:) | Initializes the instance of the Attention. Deprecated method. Use the init!(priceDecimal:currency:) method instead. |
init(priceDecimal:currency:) | Initializes the instance of the |
init(price:currency:quantity:productID:transactionID:receiptData:payload:) | Initializes the instance of the Attention. Deprecated method. Use the init!(priceDecimal:currency:quantity:productID:transactionID:receiptData:payload:) method instead. |
init(priceDecimal:currency:quantity:productID:transactionID:receiptData:payload:) | Initializes the instance of the |
Properties
currency | Currency code of the purchase in the ISO 4217 format. |
payload | Additional information to be passed about the purchase. |
price | Price. It can be negative, e.g. for refunds. Attention. The property is deprecated. Use the priceDecimal property instead. |
priceDecimal | The price that is set using the NSDecimalNumber object. It can be negative, e.g. for refunds. |
productID | ID of the product purchased. The value can contain up to 200 characters. |
quantity | Quantity of products purchased. |
receiptData | Details about the in-app purchase order from App Store. |
transactionID | Details about the in-app purchase order from App Store. |
currency | Currency code of the purchase in the ISO 4217 format. |
payload | Additional information to be passed about the purchase. |
price | Price. It can be negative, e.g. for refunds. Attention. The property is deprecated. Use the priceDecimal property instead. |
priceDecimal | The price that is set using the NSDecimalNumber object. It can be negative, e.g. for refunds. |
productID | ID of the product purchased. The value can contain up to 200 characters. |
quantity | Quantity of products purchased. |
receiptData | Details about the in-app purchase order from App Store. |
transactionID | Details about the in-app purchase order from App Store. |
Method descriptions
init(price:currency:)
init(price: Double, currency: String)
Initializes the instance of the YMMRevenueInfo
class for sending information about purchases.
price | Price. It can be negative, e.g. for refunds. |
currency | Currency code of the purchase in the 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. |
price | Price. It can be negative, e.g. for refunds. |
currency | Currency code of the purchase in the 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. |
Returns:
The instance of the YMMRevenueInfo
class.
init(priceDecimal:currency:)
init(priceDecimal: NSDecimalNumber, currency: String)
Initializes the instance of the YMMRevenueInfo
class for sending information about purchases.
priceDecimal | The price that is set using the NSDecimalNumber object. It can be negative, e.g. for refunds. |
currency | Currency code of the purchase in the 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. |
priceDecimal | The price that is set using the NSDecimalNumber object. It can be negative, e.g. for refunds. |
currency | Currency code of the purchase in the 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. |
Returns:
The instance of the YMMRevenueInfo
class.
init(price:currency:quantity:productID:transactionID:receiptData:payload:)
init(price: Double, currency: String, quantity: UInt, productID: String?, transactionID: String?, receiptData: Data?, payload: [AnyHashable : Any]?)
Initializes the instance of the YMMRevenueInfo
class for sending information about purchases.
price | Price. It can be negative, e.g. for refunds. |
currency | Currency code of the purchase in the 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. |
quantity | Quantity of products purchased. It is used in the following formula:
Note. The value cannot be negative. If the value is equal to 0, the purchase is ignored. |
productID | ID of the product purchased. The value can contain up to 200 characters. |
transactionID | Details about the in-app purchase order from App Store. |
receiptData | Details about the in-app purchase order from App Store. |
payload | Additional information to be passed about the purchase. For instance, it can be used for categorizing your products. It should contain the |
price | Price. It can be negative, e.g. for refunds. |
currency | Currency code of the purchase in the 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. |
quantity | Quantity of products purchased. It is used in the following formula:
Note. The value cannot be negative. If the value is equal to 0, the purchase is ignored. |
productID | ID of the product purchased. The value can contain up to 200 characters. |
transactionID | Details about the in-app purchase order from App Store. |
receiptData | Details about the in-app purchase order from App Store. |
payload | Additional information to be passed about the purchase. For instance, it can be used for categorizing your products. It should contain the |
Returns:
The instance of the YMMRevenueInfo
class.
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 YMMRevenueInfo
class for sending information about purchases.
priceDecimal | The price that is set using the NSDecimalNumber object. It can be negative, e.g. for refunds. |
currency | Currency code of the purchase in the 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. |
quantity | Quantity of products purchased. It is used in the following formula:
Note. The value cannot be negative. If the value is equal to 0, the purchase is ignored. |
productID | ID of the product purchased. The value can contain up to 200 characters. |
transactionID | Details about the in-app purchase order from App Store. |
receiptData | Details about the in-app purchase order from App Store. |
payload | Additional information to be passed about the purchase. For instance, it can be used for categorizing your products. It should contain the |
priceDecimal | The price that is set using the NSDecimalNumber object. It can be negative, e.g. for refunds. |
currency | Currency code of the purchase in the 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. |
quantity | Quantity of products purchased. It is used in the following formula:
Note. The value cannot be negative. If the value is equal to 0, the purchase is ignored. |
productID | ID of the product purchased. The value can contain up to 200 characters. |
transactionID | Details about the in-app purchase order from App Store. |
receiptData | Details about the in-app purchase order from App Store. |
payload | Additional information to be passed about the purchase. For instance, it can be used for categorizing your products. It should contain the |
Returns:
The instance of the YMMRevenueInfo
class.
Property descriptions
currency
var currency: String { get }
Currency code of the purchase in the ISO 4217 format.
payload
var payload: [AnyHashable : Any]? { get }
Additional information to be passed about the purchase.
price
var price: Double { get }
Price. It can be negative, e.g. for refunds.
priceDecimal
var priceDecimal: NSDecimalNumber? { get }
The price that is set using the NSDecimalNumber object. 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.