Package apple.gamekit

Class GKLocalPlayer

    • Constructor Detail

      • GKLocalPlayer

        protected GKLocalPlayer​(org.moe.natj.general.Pointer peer)
    • Method Detail

      • accessInstanceVariablesDirectly

        public static boolean accessInstanceVariablesDirectly()
      • allocWithZone

        public static GKLocalPlayer allocWithZone​(org.moe.natj.general.ptr.VoidPtr zone)
      • anonymousGuestPlayerWithIdentifier

        @NotNull
        public static @NotNull GKLocalPlayer anonymousGuestPlayerWithIdentifier​(@NotNull
                                                                                @NotNull java.lang.String guestIdentifier)
      • automaticallyNotifiesObserversForKey

        public static boolean automaticallyNotifiesObserversForKey​(@NotNull
                                                                   @NotNull java.lang.String key)
      • cancelPreviousPerformRequestsWithTarget

        public static void cancelPreviousPerformRequestsWithTarget​(@NotNull
                                                                   @NotNull java.lang.Object aTarget)
      • cancelPreviousPerformRequestsWithTargetSelectorObject

        public static void cancelPreviousPerformRequestsWithTargetSelectorObject​(@NotNull
                                                                                 @NotNull java.lang.Object aTarget,
                                                                                 @NotNull
                                                                                 @NotNull org.moe.natj.objc.SEL aSelector,
                                                                                 @Nullable
                                                                                 @Nullable java.lang.Object anArgument)
      • classFallbacksForKeyedArchiver

        @NotNull
        public static @NotNull NSArray<java.lang.String> classFallbacksForKeyedArchiver()
      • classForKeyedUnarchiver

        @NotNull
        public static @NotNull org.moe.natj.objc.Class classForKeyedUnarchiver()
      • debugDescription_static

        public static java.lang.String debugDescription_static()
      • description_static

        public static java.lang.String description_static()
      • hash_static

        public static long hash_static()
      • instanceMethodSignatureForSelector

        public static NSMethodSignature instanceMethodSignatureForSelector​(org.moe.natj.objc.SEL aSelector)
      • instancesRespondToSelector

        public static boolean instancesRespondToSelector​(org.moe.natj.objc.SEL aSelector)
      • isSubclassOfClass

        public static boolean isSubclassOfClass​(org.moe.natj.objc.Class aClass)
      • keyPathsForValuesAffectingValueForKey

        @NotNull
        public static @NotNull NSSet<java.lang.String> keyPathsForValuesAffectingValueForKey​(@NotNull
                                                                                             @NotNull java.lang.String key)
      • localPlayer

        @NotNull
        public static @NotNull GKLocalPlayer localPlayer()
      • resolveClassMethod

        public static boolean resolveClassMethod​(org.moe.natj.objc.SEL sel)
      • resolveInstanceMethod

        public static boolean resolveInstanceMethod​(org.moe.natj.objc.SEL sel)
      • setVersion_static

        public static void setVersion_static​(long aVersion)
      • superclass_static

        public static org.moe.natj.objc.Class superclass_static()
      • version_static

        public static long version_static()
      • deleteSavedGamesWithNameCompletionHandler

        public void deleteSavedGamesWithNameCompletionHandler​(@NotNull
                                                              @NotNull java.lang.String name,
                                                              @Nullable
                                                              @Nullable GKLocalPlayer.Block_deleteSavedGamesWithNameCompletionHandler handler)
        Asynchronously delete saved games with the given name. The completion handler will indicate whether or not the deletion was successful. API-Since: 8.0
      • fetchSavedGamesWithCompletionHandler

        public void fetchSavedGamesWithCompletionHandler​(@Nullable
                                                         @Nullable GKLocalPlayer.Block_fetchSavedGamesWithCompletionHandler handler)
        Asynchronously fetch saved games. The handler is called with an array of GKSavedGame objects or an error. If there is more than one saved game with the same name then a conflict exists. The application should determine the correct data to use and call resolveConflictingSavedGames:withData:completionHandler:. This may require data merging or asking the user. API-Since: 8.0
      • friends

        @Nullable
        @Deprecated
        public @Nullable NSArray<java.lang.String> friends()
        Deprecated.
        Array of player identifiers of friends for the local player. Not valid until loadFriendsWithCompletionHandler: has completed. API-Since: 4.1 Deprecated-Since: 8.0
      • generateIdentityVerificationSignatureWithCompletionHandler

        @Deprecated
        public void generateIdentityVerificationSignatureWithCompletionHandler​(@Nullable
                                                                               @Nullable GKLocalPlayer.Block_generateIdentityVerificationSignatureWithCompletionHandler completionHandler)
        Deprecated.
        Generates a signature allowing 3rd party server to authenticate the GKLocalPlayer Possible reasons for error: 1. Communications problem 2. Unauthenticated player API-Since: 7.0 Deprecated-Since: 13.5
      • isAuthenticated

        public boolean isAuthenticated()
        Authentication state
      • isUnderage

        public boolean isUnderage()
        Indicates if a player is under age
      • loadDefaultLeaderboardIdentifierWithCompletionHandler

        public void loadDefaultLeaderboardIdentifierWithCompletionHandler​(@Nullable
                                                                          @Nullable GKLocalPlayer.Block_loadDefaultLeaderboardIdentifierWithCompletionHandler completionHandler)
        Load the default leaderboard identifier for the local player Possible reasons for error: 1. Communications problem 2. Unauthenticated player 3. Leaderboard not present API-Since: 7.0
      • loadFriendsWithCompletionHandler

        @Deprecated
        public void loadFriendsWithCompletionHandler​(@Nullable
                                                     @Nullable GKLocalPlayer.Block_loadFriendsWithCompletionHandler completionHandler)
        Deprecated.
        This method is obsolete. It will never be invoked and its implementation does nothing** API-Since: 4.1 Deprecated-Since: 8.0
      • loadRecentPlayersWithCompletionHandler

        public void loadRecentPlayersWithCompletionHandler​(@Nullable
                                                           @Nullable GKLocalPlayer.Block_loadRecentPlayersWithCompletionHandler completionHandler)
        Asynchronously load the recent players list as an array of GKPlayer. A recent player is someone that you have played a game with or is a legacy game center friend. Calls completionHandler when finished. Error will be nil on success. Possible reasons for error: 1. Communications problem 2. Unauthenticated player API-Since: 10.0
      • playerHasConflictingSavedGames

        public void playerHasConflictingSavedGames​(@NotNull
                                                   @NotNull GKPlayer player,
                                                   @NotNull
                                                   @NotNull NSArray<? extends GKSavedGame> savedGames)
        Description copied from interface: GKSavedGameListener
        Called when a conflict has arisen between different versions of the same saved game. This can happen when multiple devices write to the same saved game while one or more is offline. The application should determine the correct data to use, then call resolveConflictingSavedGames:withData:completionHandler:. This may require data merging or asking the user. API-Since: 8.0
        Specified by:
        playerHasConflictingSavedGames in interface GKSavedGameListener
      • registerListener

        public void registerListener​(@NotNull
                                     @NotNull GKLocalPlayerListener listener)
        A single listener may be registered once. Registering multiple times results in undefined behavior. The registered listener will receive callbacks for any selector it responds to. API-Since: 7.0
      • resolveConflictingSavedGamesWithDataCompletionHandler

        public void resolveConflictingSavedGamesWithDataCompletionHandler​(@NotNull
                                                                          @NotNull NSArray<? extends GKSavedGame> conflictingSavedGames,
                                                                          @NotNull
                                                                          @NotNull NSData data,
                                                                          @Nullable
                                                                          @Nullable GKLocalPlayer.Block_resolveConflictingSavedGamesWithDataCompletionHandler handler)
        Asynchronously resolve a saved game conflict. This deletes all versions included in conflictingSavedGames and creates a new version with the given data. The completion handler is called with the newly created save and all other remaining versions or an error. API-Since: 8.0
      • saveGameDataWithNameCompletionHandler

        public void saveGameDataWithNameCompletionHandler​(@NotNull
                                                          @NotNull NSData data,
                                                          @NotNull
                                                          @NotNull java.lang.String name,
                                                          @Nullable
                                                          @Nullable GKLocalPlayer.Block_saveGameDataWithNameCompletionHandler handler)
        Asynchronously save game data. If a saved game with that name already exists it is overwritten, otherwise a new one is created. The completion handler is called with the new / modified GKSavedGame or an error. If the saved game was in conflict then the overwritten version will be the one with the same deviceName if present, otherwise the most recent overall. API-Since: 8.0
      • setDefaultLeaderboardIdentifierCompletionHandler

        public void setDefaultLeaderboardIdentifierCompletionHandler​(@NotNull
                                                                     @NotNull java.lang.String leaderboardIdentifier,
                                                                     @Nullable
                                                                     @Nullable GKLocalPlayer.Block_setDefaultLeaderboardIdentifierCompletionHandler completionHandler)
        Set the default leaderboard for the current game Possible reasons for error: 1. Communications problem 2. Unauthenticated player 3. Leaderboard not present API-Since: 7.0
      • unregisterAllListeners

        public void unregisterAllListeners()
        API-Since: 7.0
      • unregisterListener

        public void unregisterListener​(@NotNull
                                       @NotNull GKLocalPlayerListener listener)
        API-Since: 7.0
      • isMultiplayerGamingRestricted

        public boolean isMultiplayerGamingRestricted()
        A Boolean value that declares whether or not multiplayer gaming is restricted on this device. API-Since: 13.0
      • loadChallengableFriendsWithCompletionHandler

        public void loadChallengableFriendsWithCompletionHandler​(@Nullable
                                                                 @Nullable GKLocalPlayer.Block_loadChallengableFriendsWithCompletionHandler completionHandler)
        Asynchronously load the challengable friends list as an array of GKPlayer. A challengable player is a friend player with friend level FL1 and FL2. Calls completionHandler when finished. Error will be nil on success. Possible reasons for error: 1. Communications problem 2. Unauthenticated player
      • local

        @NotNull
        public static @NotNull GKLocalPlayer local()
        Obtain the primary GKLocalPlayer object. The player is only available for offline play until logged in. A temporary player is created if no account is set up. API-Since: 13.0
      • fetchItemsForIdentityVerificationSignature

        public void fetchItemsForIdentityVerificationSignature​(@Nullable
                                                               @Nullable GKLocalPlayer.Block_fetchItemsForIdentityVerificationSignature completionHandler)
        Generates a signature allowing 3rd party server to authenticate the GKLocalPlayer Possible reasons for error: 1. Communications problem 2. Unauthenticated player API-Since: 13.5
      • isPersonalizedCommunicationRestricted

        public boolean isPersonalizedCommunicationRestricted()
        A Boolean value that declares whether personalized communication is restricted on this device. If it is restricted, the player will not be able to read or write personalized messages on game invites, challenges, or enable voice communication in multiplayer games. Note: this value will always be true when isUnderage is true. API-Since: 14.0
      • isPresentingFriendRequestViewController

        public boolean isPresentingFriendRequestViewController()
        observable property that becomes true when the friend request view controller is displayed. It becomes false when it is dismissed API-Since: 15.0
      • loadFriends

        public void loadFriends​(@NotNull
                                @NotNull GKLocalPlayer.Block_loadFriends completionHandler)
        * loadFriends: * * Discussion: * Calling this method will asynchronously load the player Game Center's * friend list scoped to the calling application. * Calls handler when finished. * * When -loadFriendsAuthorizationStatus == GKFriendsAuthorizationStatusNotDetermined or * GKFriendsAuthorizationStatusRemoved, calling this method will trigger a * prompt to request friend list authorization from the user. * * When -loadFriendsAuthorizationStatus == GKFriendsAuthorizationStatusAuthorized, * This method will return an array of GKPlayers which have agreed to share their * friend list with the calling application based on the same bundleID. * * The NSGKFriendListUsageDescription key must be specified in your * Info.plist; otherwise, GKErrorFriendListUsageDescriptionMissing will be returned, * as your app will be assumed not to support friend list. * Possible reasons for error: * - Communication error with server. * - AuthorizationStatus != GKFriendsAuthorizationStatusAuthorized * - NSGKFriendListUsageDescription missing from your Info.plist * - User is not online * - Unauthenticated player API-Since: 14.5
      • loadFriendsAuthorizationStatus

        public void loadFriendsAuthorizationStatus​(@NotNull
                                                   @NotNull GKLocalPlayer.Block_loadFriendsAuthorizationStatus completionHandler)
        loadFriendsAuthorizationStatus: Discussion: Calling this will asynchronously load the current friend list authorization status of calling application. There may be an server call involve so there could be some slight delay in getting the authorization status via handler block. Calls handler when finished. Error will be nil on success. Possible reasons for error: - Communication error with server. - NSGKFriendListUsageDescription missing from your Info.plist - User is not online - Unauthenticated player API-Since: 14.5
      • loadFriendsWithIdentifiersCompletionHandler

        public void loadFriendsWithIdentifiersCompletionHandler​(@NotNull
                                                                @NotNull NSArray<java.lang.String> identifiers,
                                                                @NotNull
                                                                @NotNull GKLocalPlayer.Block_loadFriendsWithIdentifiersCompletionHandler completionHandler)
        loadFriendsWithIdentifiers:completionHandler: Discussion: Calling this method will asynchronously return a list of GKPlayers to the provided scoped identifiers (gamePlayerID or teamPlayerID) that you can use to interact with GameKit framework. Calls handler when finished. When -loadFriendsAuthorizationStatus == GKFriendsAuthorizationStatusNotDetermined or GKFriendsAuthorizationStatusRemoved, calling this method will trigger a prompt to request friend list authorization from the user. This method accepts gamePlayerID or teamPlayerID, and if the identifier is valid, we will return a GKPlayer object correspond to that identifier. No GKPlayer object will be returned for invalid identifiers. If all supplied identifiers are invalid, and empty array will be returned. If a player's friend revoke the friend list authorization for your application, we will no longer return the GKPlayer object and you should delete the data you've collected for the player with gamePlayerID or teamPlayerID on your end. Possible reasons for error: - Communication error with server. - AuthorizationStatus != GKFriendsAuthorizationStatusAuthorized - NSGKFriendListUsageDescription missing from your Info.plist - Unauthenticated player - User is not online API-Since: 14.5
      • presentFriendRequestCreatorFromViewControllerError

        public boolean presentFriendRequestCreatorFromViewControllerError​(@NotNull
                                                                          @NotNull UIViewController viewController,
                                                                          @Nullable
                                                                          @Nullable org.moe.natj.general.ptr.Ptr<NSError> error)
        presentFriendRequestCreatorFromViewController: Discussion: iOS only. When invoked, a Messages sheet will be presented on the viewController passed in, using the existing flow of presentation on behalf of an application. If an error is returned, control are returned directly to the application, without presentation. Possible reasons for error: - The local player user account is not allowed to add friends - The device is not allowing outgoing traffic at the time of the operation API-Since: 15.0
      • useStoredAccessor

        @Deprecated
        public static boolean useStoredAccessor()
        Deprecated.