TPStashEvent.InAppPurchase

public int InAppPurchase(
    string player_uuid,
    string character_uuid,
    string purchasable_slug,
    float purchase_quantity,
    float purchase_unit_price,
    float purchase_total_price,
    currencyCode purchase_currency_code,
    [bool? is_ad_remove = null]
);

Description

InAppPurchase collects the data of a character’s in-app purchases. It needs to be called when an event of an in-app purchase occurs during the game. It can be used for the analysis of purchase-related personas.

It returns 1 for success and -1 for failure. If -1 is returned, you can see the following message in the Unity editor console in TentuPlay debug mode:

TPError||ERROR inserting table_name: exception_error_message

Parameters

Name Description Required

player_uuid

Player’s unique ID (not a character’s ID) such as Steam user ID and Google Play user ID

Required

character_uuid

Player’s character’s unique lD

If there is no character in the game or If you want to use it for the player, not a character, set character_uuid to TentuPlayKeyword._DUMMY_CHARACTER_ID_.

Required

purchasable_slug

Unique identifier of the purchased product

Required

purchase_quantity

The number or amount of purchased products

Required

purchase_unit_price

Unit price of the purchased product

Required

purchase_total_price

Total price of the purchased products

Required

purchase_currency_code

Three-letter alphabetic code of currency used for the purchase defined by ISO 4217

Required

is_ad_remove

Whether or not the purchased item either includes or is related to in-app ad removal

Optional