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_updated signal

to notify you of the status of purchases as well as the purchase_intent signal

letting you know any purchase intents. You should register the signals immediately after

instantiating.

MethodsΒΆ

void

purchase(product: StoreProduct)

void

request_products(productIds: PackedStringArray)

void

restore_purchases()


SignalsΒΆ

products_request_completed(products: Array, status: int) πŸ”—

Emitted when a product request completes.

products is an Array of StoreProducts (or nulls).

status indicates success or failure.


purchase_completed(transaction: StoreTransaction, status: int, error_message: String) πŸ”—

Emitted when a purchase completes.

transaction is the StoreTransaction on success.

status indicates the result (OK, cancelled, invalid product, etc.).

error_message contains 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.