StoreKitManagerΒΆ
Inherits: RefCounted < Object
Manages StoreKit interactions such as requesting products, purchasing, and restoring purchases.
DescriptionΒΆ
This class handles the core StoreKit functionality. It provides methods to fetch product information from the App Store, initiate purchases,
restore previous purchases and be notified of the current status of the purchase upon startup.
Upon creation, this class will start immediately to raise the
transaction_updatedsignalto notify you of the status of purchases as well as the
purchase_intentsignalletting you know any purchase intents. You should register the signals immediately after
instantiating.
MethodsΒΆ
void |
purchase(product: StoreProduct) |
void |
request_products(productIds: PackedStringArray) |
void |
SignalsΒΆ
products_request_completed(products: Array, status: int) π
Emitted when a product request completes.
productsis an Array of StoreProducts (or nulls).
statusindicates success or failure.
purchase_completed(transaction: StoreTransaction, status: int, error_message: String) π
Emitted when a purchase completes.
transactionis the StoreTransaction on success.
statusindicates the result (OK, cancelled, invalid product, etc.).
error_messagecontains error details if failed.
purchase_intent(arg1: StoreProduct) π
There is currently no description for this signal. Please help us by contributing one!
restore_completed(status: int, error_message: String) π
Emitted when the restore process completes. status is the StoreKitStatus, and error_message is an error string if applicable.
transaction_updated(transaction: StoreTransaction) π
Emitted when a transaction is updated (e.g., a subscription renews or a purchase is approved externally). transaction is the updated StoreTransaction.
EnumerationsΒΆ
enum StoreKitStatus: π
StoreKitStatus ok = 0
The operation completed successfully.
StoreKitStatus invalidProduct = 1
The product identifier is invalid.
StoreKitStatus cancelled = 2
The operation was cancelled.
StoreKitStatus unverifiedTransaction = 3
The transaction could not be verified.
StoreKitStatus userCancelled = 4
The user cancelled the operation.
StoreKitStatus purchasePending = 5
The purchase is pending (e.g., waiting for parental approval).
StoreKitStatus unknownStatus = 6
An unknown status occurred.
Method DescriptionsΒΆ
void purchase(product: StoreProduct) π
Initiates the purchase of a specific product, e.g. purchase(product).
void request_products(productIds: PackedStringArray) π
Requests product information for a list of product identifiers, e.g. request_products(["com.example.product1", "com.example.product2"]).
void restore_purchases() π
Restores previously purchased non-consumable products and auto-renewable subscriptions.