Unity IAP cross-platform wrapper for real money purchases, as well as for virtual ingame purchases (for virtual currency). Initializes the Unity IAP billing system, handles different store interfaces and integrates their callbacks respectively.
More...
|
void | Initialize () |
| Initializes the IAP service with a platform-dependant billing connection. More...
|
|
void | OnSceneWasLoaded (Scene scene, LoadSceneMode m) |
| Detect and initiate the ShopManager initialization on scene changes. More...
|
|
void | OnInitialized (IStoreController ctrl, IExtensionProvider ext) |
| Initialization callback of Unity IAP. Optionally: verify old purchases online. Once we've received the product list, we overwrite the existing shop item values with this online data. More...
|
|
PurchaseProcessingResult | ProcessPurchase (PurchaseEventArgs e) |
| This will be called when a purchase completes. Optional: verify new product receipt. More...
|
|
void | PurchaseVerified (string id) |
| Sets a product to purchased after successful verification (or without). This alters the database entry for non-consumable or products with usage as well. More...
|
|
void | OnInitializeFailed (InitializationFailureReason error) |
| Callback of Unity IAP returning why the store could not be initialized to begin with. More...
|
|
void | OnPurchaseFailed (Product item, PurchaseFailureReason reason) |
| This will be called when an attempted purchase fails. More...
|
|
|
static bool | isDebug = false |
| Debug messages are enabled in Development build automatically. More...
|
|
static IStoreController | controller |
|
static IExtensionProvider | extensions |
|
Unity IAP cross-platform wrapper for real money purchases, as well as for virtual ingame purchases (for virtual currency). Initializes the Unity IAP billing system, handles different store interfaces and integrates their callbacks respectively.
Returns the list of currencies defined in the IAP Settings editor.
static string GetCurrentUpgrade |
( |
string |
productId | ) |
|
|
static |
Returns the last purchased upgrade id of a product, or the main product itself if it hasn't been purchased yet.
static string GetIAPIdentifier |
( |
string |
storeId | ) |
|
|
static |
Returns the global identifier of an in-app product, specified in the IAP Settings editor.
static string [] GetIAPKeys |
( |
| ) |
|
|
static |
Returns a string array of all IAP ids. Used by DBManager.
static string GetIAPObjectGroupName |
( |
string |
id | ) |
|
|
static |
Returns the group name of a specific product id. Used by DBManager.
static List<string> GetIAPUpgrades |
( |
string |
productId | ) |
|
|
static |
Returns a list of all upgrade ids associated to a product.
Returns a static reference to this script.
static string GetNextUpgrade |
( |
string |
productId | ) |
|
|
static |
Returns the next unpurchased upgrade id of a product.
static ProductDefinition [] GetProductDefinitions |
( |
| ) |
|
|
static |
Returns the list of products used when initializing Unity IAP.
static string [] GetRealKeys |
( |
| ) |
|
|
static |
Returns a string array of all real money IAP ids only.
Initializes the IAP service with a platform-dependant billing connection.
void OnInitialized |
( |
IStoreController |
ctrl, |
|
|
IExtensionProvider |
ext |
|
) |
| |
Initialization callback of Unity IAP. Optionally: verify old purchases online. Once we've received the product list, we overwrite the existing shop item values with this online data.
void OnInitializeFailed |
( |
InitializationFailureReason |
error | ) |
|
Callback of Unity IAP returning why the store could not be initialized to begin with.
void OnPurchaseFailed |
( |
Product |
item, |
|
|
PurchaseFailureReason |
reason |
|
) |
| |
This will be called when an attempted purchase fails.
static void OnPurchaseFailed |
( |
string |
error | ) |
|
|
static |
Overload for failed purchases with string error message.
void OnSceneWasLoaded |
( |
Scene |
scene, |
|
|
LoadSceneMode |
m |
|
) |
| |
Detect and initiate the ShopManager initialization on scene changes.
static void OnTransactionsRestored |
( |
bool |
success | ) |
|
|
static |
Callback invoked after initiating a restore attempt.
PurchaseProcessingResult ProcessPurchase |
( |
PurchaseEventArgs |
e | ) |
|
This will be called when a purchase completes. Optional: verify new product receipt.
static void PurchaseProduct |
( |
string |
productId | ) |
|
|
static |
Purchase product based on its product id. If the productId matches "restore", we restore transactions instead. Our delegates then fire the appropriate succeeded/fail/restore event.
Overload for purchasing virtual product based on its product identifier.
void PurchaseVerified |
( |
string |
id | ) |
|
Sets a product to purchased after successful verification (or without). This alters the database entry for non-consumable or products with usage as well.
static void RestoreTransactions |
( |
| ) |
|
|
static |
Restore already purchased user's transactions for non consumable IAPs.
bool autoInitialize = true |
Toggle that defines whether the IAPManager should initialize itself on first load.
IStoreController controller |
|
static |
list of virtual currency, set in the IAP Settings editor
IExtensionProvider extensions |
|
static |
dictionary of product ids, mapped to the corresponding IAPObject for quick lookup
In app products, set in the IAP Settings editor
Debug messages are enabled in Development build automatically.
Keys required for some store initialization processes.
Action<string> purchaseFailedEvent |
|
static |
fired when a purchase fails, delivering its product id
Action<string> purchaseSucceededEvent |
|
static |
fired when a purchase succeeds, delivering its product id
The documentation for this class was generated from the following file: