: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/GameCenterManager.xml. .. _class_GameCenterManager: GameCenterManager ================= **Inherits:** :ref:`RefCounted` **<** :ref:`Object` Entry point for authenticating the Apple Game Center local player. .. rst-class:: classref-introduction-group Description ----------- Create a ``GameCenterManager`` when your game starts to present Apple's authentication UI and track whether the player is signed in, as described in ``GameCenterGuide.md``. Once authenticated you can fetch the :ref:`local_player` to access achievements, leaderboards, friends, and matchmaking helpers. See Apple's documentation for `Apple's GKLocalPlayer reference `__ to learn more about the underlying authentication flow. Authentication example from the guide: .. tabs:: .. code-tab:: gdscript var game_center: GameCenterManager func _ready() -> void: game_center = GameCenterManager.new() game_center.authentication_error.connect(func(error: String) -> void: print("Received error %s" % error) ) game_center.authentication_result.connect(func(status: bool) -> void: print("Authentication updated, status: %s" % status) ) .. rst-class:: classref-reftable-group Properties ---------- .. table:: :widths: auto +-------------------------------------------+--------------------------------------------------------------------+ | :ref:`GKLocalPlayer` | :ref:`local_player` | +-------------------------------------------+--------------------------------------------------------------------+ .. rst-class:: classref-reftable-group Methods ------- .. table:: :widths: auto +--------+------------------------------------------------------------------------+ | |void| | :ref:`authenticate`\ (\ ) | +--------+------------------------------------------------------------------------+ .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Signals ------- .. _class_GameCenterManager_signal_authentication_error: .. rst-class:: classref-signal **authentication_error**\ (\ arg1\: :ref:`String`\ ) :ref:`🔗` Emitted whenever GameKit authentication fails. The argument is the localized error string provided by Apple. .. rst-class:: classref-item-separator ---- .. _class_GameCenterManager_signal_authentication_result: .. rst-class:: classref-signal **authentication_result**\ (\ arg1\: :ref:`bool`\ ) :ref:`🔗` Emitted after ``authenticate()`` finishes. The boolean is ``true`` when ``GKLocalPlayer.local.isAuthenticated`` reports success. .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Property Descriptions --------------------- .. _class_GameCenterManager_property_local_player: .. rst-class:: classref-property :ref:`GKLocalPlayer` **local_player** :ref:`🔗` .. rst-class:: classref-property-setget - |void| **set_local_player**\ (\ value\: :ref:`GKLocalPlayer`\ ) - :ref:`GKLocalPlayer` **get_local_player**\ (\ ) Returns the wrapper for ``GKLocalPlayer.local``. Use this after successful authentication to call methods such as ``load_friends()`` or ``fetch_items_for_identity_verification_signature()``. .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Method Descriptions ------------------- .. _class_GameCenterManager_method_authenticate: .. rst-class:: classref-method |void| **authenticate**\ (\ ) :ref:`🔗` Triggers ``GKLocalPlayer.authenticateHandler``, presenting Apple's login sheet when needed. Emits :ref:`authentication_result` with the new status and :ref:`authentication_error` if GameKit reports a failure. .. |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.)`