Package apple.gamekit

Class GKLeaderboard

  • All Implemented Interfaces:
    NSObject

    public class GKLeaderboard
    extends NSObject
    GKLeaderboard represents a single instance of a leaderboard for the current game. Leaderboards can be of the following types: 1. Classic - Traditional, non-expiring leaderboards 2. Recurring - Periodic timed leaderboards that follow a recurrence rule defined in App Store Connect.
    • Constructor Detail

      • GKLeaderboard

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

      • accessInstanceVariablesDirectly

        public static boolean accessInstanceVariablesDirectly()
      • allocWithZone

        public static java.lang.Object allocWithZone​(org.moe.natj.general.ptr.VoidPtr zone)
      • automaticallyNotifiesObserversForKey

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

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

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

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

        public static 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

        public static NSSet<java.lang.String> keyPathsForValuesAffectingValueForKey​(java.lang.String key)
      • loadLeaderboardsWithCompletionHandler

        public static void loadLeaderboardsWithCompletionHandler​(GKLeaderboard.Block_loadLeaderboardsWithCompletionHandler completionHandler)
        Loads the array of GKLeaderboard for your app Possible reasons for error: 1. Communications problem 2. Unauthenticated player 3. Leaderboard not present
      • new_objc

        public static java.lang.Object new_objc()
      • 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()
      • category

        @Deprecated
        public java.lang.String category()
        Deprecated.
        Deprecated. Use identifier instead.
      • groupIdentifier

        public java.lang.String groupIdentifier()
        set when leaderboards have been designated a game group; set when loadLeaderboardsWithCompletionHandler has been called for leaderboards that support game groups
      • identifier

        public java.lang.String identifier()
        leaderboardID. If nil, fetch the aggregate leaderboard.
      • init

        public GKLeaderboard init()
        Default is the range 1-10 with Global/AllTime scopes. If you want to change the scopes or range, set the properites before loading the scores.
        Overrides:
        init in class NSObject
      • initWithPlayerIDs

        @Deprecated
        public GKLeaderboard initWithPlayerIDs​(NSArray<java.lang.String> playerIDs)
        Deprecated.
      • initWithPlayers

        public GKLeaderboard initWithPlayers​(NSArray<? extends GKPlayer> players)
        Specify an array of GKPlayers. For example, the players who are in a match together Defaults to AllTime score, if you want to change the timeScope, set the property before loading the scores. Range and playerScope are not applicable. players may not be nil.
      • isLoading

        public boolean isLoading()
        This property is true if the leaderboard is currently loading
      • loadScoresWithCompletionHandler

        public void loadScoresWithCompletionHandler​(GKLeaderboard.Block_loadScoresWithCompletionHandler completionHandler)
        Load the scores for this leader board asynchronously. Error will be nil on success. Possible reasons for error: 1. Communications problem 2. Unauthenticated player
      • localPlayerScore

        public GKScore localPlayerScore()
        The local player's score
      • maxRange

        public long maxRange()
        The maxRange which represents the size of the leaderboard is not valid until loadScores: has completed.
      • playerScope

        public long playerScope()
        Filter on friends. Does not apply to leaderboard initialized with players.
      • range

        public NSRange range()
        Leaderboards start at index 1 and the length should be less than 100. Does not apply to leaderboards initialized with players. Exception will be thrown if developer tries to set an invalid range.
      • scores

        public NSArray<? extends GKScore> scores()
        Scores are not valid until loadScores: has completed.
      • setCategory

        @Deprecated
        public void setCategory​(java.lang.String value)
        Deprecated.
        Deprecated. Use identifier instead.
      • setIdentifier

        public void setIdentifier​(java.lang.String value)
        leaderboardID. If nil, fetch the aggregate leaderboard.
      • setPlayerScope

        public void setPlayerScope​(long value)
        Filter on friends. Does not apply to leaderboard initialized with players.
      • setRange

        public void setRange​(NSRange value)
        Leaderboards start at index 1 and the length should be less than 100. Does not apply to leaderboards initialized with players. Exception will be thrown if developer tries to set an invalid range.
      • setTimeScope

        public void setTimeScope​(long value)
      • timeScope

        public long timeScope()
      • title

        public java.lang.String title()
        Localized title
      • baseLeaderboardID

        public java.lang.String baseLeaderboardID()
        Leaderboard ID defined in App Store Connect that this instance is associated with
      • duration

        public double duration()
        Duration from startDate during which this leaderboard instance accepts score submissions (only applicable to recurring leaderboards)
      • loadEntriesForPlayerScopeTimeScopeRangeCompletionHandler

        public void loadEntriesForPlayerScopeTimeScopeRangeCompletionHandler​(long playerScope,
                                                                             long timeScope,
                                                                             NSRange range,
                                                                             GKLeaderboard.Block_loadEntriesForPlayerScopeTimeScopeRangeCompletionHandler completionHandler)
        Loads leaderboard entries based on the supplied parameters. playerScope - Friends or Global timeScope - Today, Week, All Time (Only applicable to classic leaderboards) range - Range of ranked entries to return (minimum start index 1, maximum length 100) Upon completion, will return: localPlayerEntry - entry for the local player entries - requested entries matching supplied parameters totalPlayerCount - total player count matching specified scope
      • loadEntriesForPlayersTimeScopeCompletionHandler

        public void loadEntriesForPlayersTimeScopeCompletionHandler​(NSArray<? extends GKPlayer> players,
                                                                    long timeScope,
                                                                    GKLeaderboard.Block_loadEntriesForPlayersTimeScopeCompletionHandler completionHandler)
        Loads leaderboard entries for specific players based on the supplied parameters. players - Array of players to load entries for timeScope - Today, Week, All Time (Only applicable to classic leaderboards) Upon completion, will return: localPlayerEntry - entry for the local player entries - requested entries matching supplied parameters
      • loadLeaderboardsWithIDsCompletionHandler

        public static void loadLeaderboardsWithIDsCompletionHandler​(NSArray<java.lang.String> leaderboardIDs,
                                                                    GKLeaderboard.Block_loadLeaderboardsWithIDsCompletionHandler completionHandler)
        Loads classic and recurring leaderboards associated with the supplied App Store Connect leaderboard IDs. If leaderboardIDs is nil, this loads all classic and recurring leaderboards for this game.
      • loadPreviousOccurrenceWithCompletionHandler

        public void loadPreviousOccurrenceWithCompletionHandler​(GKLeaderboard.Block_loadPreviousOccurrenceWithCompletionHandler completionHandler)
        Loads the occurrence preceding this occurrence for a recurring leaderboard in which the local player submitted a score. If no previous occurrence is found that the player submitted a score to, then the most recent previous occurrence is returned.
      • nextStartDate

        public NSDate nextStartDate()
        Date and time the next instance will start accepting score submissions (only applicable to recurring leaderboards)
      • startDate

        public NSDate startDate()
        Date and time this instance started accepting score submissions (only applicable to recurring leaderboards)
      • submitScoreContextPlayerCompletionHandler

        public void submitScoreContextPlayerCompletionHandler​(long score,
                                                              long context,
                                                              GKPlayer player,
                                                              GKLeaderboard.Block_submitScoreContextPlayerCompletionHandler completionHandler)
        Instance method to submit a single score to the leaderboard associated with this instance score - earned by the player context - developer supplied metadata associated with the player's score player - the player for whom this score is being submitted
      • submitScoreContextPlayerLeaderboardIDsCompletionHandler

        public static void submitScoreContextPlayerLeaderboardIDsCompletionHandler​(long score,
                                                                                   long context,
                                                                                   GKPlayer player,
                                                                                   NSArray<java.lang.String> leaderboardIDs,
                                                                                   GKLeaderboard.Block_submitScoreContextPlayerLeaderboardIDsCompletionHandler completionHandler)
        Class method to submit a single score to multiple leaderboards score - earned by the player context - developer supplied metadata associated with the player's score player - the player for whom this score is being submitted leaderboardIDs - one or more leaderboard IDs defined in App Store Connect
      • type

        public long type()
        Type of leaderboard