:github_url: hide .. DO NOT EDIT THIS FILE!!! .. Generated automatically from Godot engine sources. .. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py. .. XML source: https://github.com/godotengine/godot/tree/master/../../GodotApplePlugins/doc_classes/StoreKitManager.xml. .. _class_StoreKitManager: StoreKitManager =============== **Inherits:** :ref:`RefCounted` **<** :ref:`Object` Manages StoreKit interactions such as requesting products, purchasing, and restoring purchases. .. rst-class:: classref-introduction-group 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. .. rst-class:: classref-reftable-group Methods ------- .. table:: :widths: auto +--------+----------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`purchase`\ (\ product\: :ref:`StoreProduct`\ ) | +--------+----------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`request_products`\ (\ productIds\: :ref:`PackedStringArray`\ ) | +--------+----------------------------------------------------------------------------------------------------------------------------------------------+ | |void| | :ref:`restore_purchases`\ (\ ) | +--------+----------------------------------------------------------------------------------------------------------------------------------------------+ .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Signals ------- .. _class_StoreKitManager_signal_products_request_completed: .. rst-class:: classref-signal **products_request_completed**\ (\ products\: :ref:`Array`, status\: :ref:`int`\ ) :ref:`🔗` Emitted when a product request completes. ``products`` is an Array of :ref:`StoreProduct`\ s (or nulls). ``status`` indicates success or failure. .. rst-class:: classref-item-separator ---- .. _class_StoreKitManager_signal_purchase_completed: .. rst-class:: classref-signal **purchase_completed**\ (\ transaction\: :ref:`StoreTransaction`, status\: :ref:`int`, error_message\: :ref:`String`\ ) :ref:`🔗` Emitted when a purchase completes. ``transaction`` is the :ref:`StoreTransaction` on success. ``status`` indicates the result (OK, cancelled, invalid product, etc.). ``error_message`` contains error details if failed. .. rst-class:: classref-item-separator ---- .. _class_StoreKitManager_signal_purchase_intent: .. rst-class:: classref-signal **purchase_intent**\ (\ arg1\: :ref:`StoreProduct`\ ) :ref:`🔗` .. container:: contribute There is currently no description for this signal. Please help us by `contributing one `__! .. rst-class:: classref-item-separator ---- .. _class_StoreKitManager_signal_restore_completed: .. rst-class:: classref-signal **restore_completed**\ (\ status\: :ref:`int`, error_message\: :ref:`String`\ ) :ref:`🔗` Emitted when the restore process completes. ``status`` is the :ref:`StoreKitStatus`, and ``error_message`` is an error string if applicable. .. rst-class:: classref-item-separator ---- .. _class_StoreKitManager_signal_transaction_updated: .. rst-class:: classref-signal **transaction_updated**\ (\ transaction\: :ref:`StoreTransaction`\ ) :ref:`🔗` Emitted when a transaction is updated (e.g., a subscription renews or a purchase is approved externally). ``transaction`` is the updated :ref:`StoreTransaction`. .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Enumerations ------------ .. _enum_StoreKitManager_StoreKitStatus: .. rst-class:: classref-enumeration enum **StoreKitStatus**: :ref:`🔗` .. _class_StoreKitManager_constant_ok: .. rst-class:: classref-enumeration-constant :ref:`StoreKitStatus` **ok** = ``0`` The operation completed successfully. .. _class_StoreKitManager_constant_invalidProduct: .. rst-class:: classref-enumeration-constant :ref:`StoreKitStatus` **invalidProduct** = ``1`` The product identifier is invalid. .. _class_StoreKitManager_constant_cancelled: .. rst-class:: classref-enumeration-constant :ref:`StoreKitStatus` **cancelled** = ``2`` The operation was cancelled. .. _class_StoreKitManager_constant_unverifiedTransaction: .. rst-class:: classref-enumeration-constant :ref:`StoreKitStatus` **unverifiedTransaction** = ``3`` The transaction could not be verified. .. _class_StoreKitManager_constant_userCancelled: .. rst-class:: classref-enumeration-constant :ref:`StoreKitStatus` **userCancelled** = ``4`` The user cancelled the operation. .. _class_StoreKitManager_constant_purchasePending: .. rst-class:: classref-enumeration-constant :ref:`StoreKitStatus` **purchasePending** = ``5`` The purchase is pending (e.g., waiting for parental approval). .. _class_StoreKitManager_constant_unknownStatus: .. rst-class:: classref-enumeration-constant :ref:`StoreKitStatus` **unknownStatus** = ``6`` An unknown status occurred. .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Method Descriptions ------------------- .. _class_StoreKitManager_method_purchase: .. rst-class:: classref-method |void| **purchase**\ (\ product\: :ref:`StoreProduct`\ ) :ref:`🔗` Initiates the purchase of a specific product, e.g. ``purchase(product)``. .. rst-class:: classref-item-separator ---- .. _class_StoreKitManager_method_request_products: .. rst-class:: classref-method |void| **request_products**\ (\ productIds\: :ref:`PackedStringArray`\ ) :ref:`🔗` Requests product information for a list of product identifiers, e.g. ``request_products(["com.example.product1", "com.example.product2"])``. .. rst-class:: classref-item-separator ---- .. _class_StoreKitManager_method_restore_purchases: .. rst-class:: classref-method |void| **restore_purchases**\ (\ ) :ref:`🔗` Restores previously purchased non-consumable products and auto-renewable subscriptions. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` .. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)` .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)` .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)` .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)` .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)` .. |void| replace:: :abbr:`void (No return value.)`