Interface GKTurnBasedEventListener

    • Method Detail

      • playerDidRequestMatchWithOtherPlayers

        default void playerDidRequestMatchWithOtherPlayers​(@NotNull
                                                           @NotNull GKPlayer player,
                                                           @NotNull
                                                           @NotNull NSArray<? extends GKPlayer> playersToInvite)
        If Game Center initiates a match the developer should create a GKTurnBasedMatch from playersToInvite and present a GKTurnbasedMatchmakerViewController. API-Since: 8.0
      • playerDidRequestMatchWithPlayers

        @Deprecated
        default void playerDidRequestMatchWithPlayers​(@NotNull
                                                      @NotNull GKPlayer player,
                                                      @NotNull
                                                      @NotNull NSArray<java.lang.String> playerIDsToInvite)
        Deprecated.
        Deprecated API-Since: 7.0 Deprecated-Since: 8.0
      • playerMatchEnded

        default void playerMatchEnded​(@NotNull
                                      @NotNull GKPlayer player,
                                      @NotNull
                                      @NotNull GKTurnBasedMatch match)
        called when the match has ended.
      • playerReceivedExchangeCancellationForMatch

        default void playerReceivedExchangeCancellationForMatch​(@NotNull
                                                                @NotNull GKPlayer player,
                                                                @NotNull
                                                                @NotNull GKTurnBasedExchange exchange,
                                                                @NotNull
                                                                @NotNull GKTurnBasedMatch match)
        this is called when an exchange is canceled by the sender. API-Since: 7.0
      • playerReceivedExchangeRepliesForCompletedExchangeForMatch

        default void playerReceivedExchangeRepliesForCompletedExchangeForMatch​(@NotNull
                                                                               @NotNull GKPlayer player,
                                                                               @NotNull
                                                                               @NotNull NSArray<? extends GKTurnBasedExchangeReply> replies,
                                                                               @NotNull
                                                                               @NotNull GKTurnBasedExchange exchange,
                                                                               @NotNull
                                                                               @NotNull GKTurnBasedMatch match)
        called when all players either respond or timeout responding to this request. This is sent to both the turn holder and the initiator of the exchange API-Since: 7.0
      • playerReceivedExchangeRequestForMatch

        default void playerReceivedExchangeRequestForMatch​(@NotNull
                                                           @NotNull GKPlayer player,
                                                           @NotNull
                                                           @NotNull GKTurnBasedExchange exchange,
                                                           @NotNull
                                                           @NotNull GKTurnBasedMatch match)
        this is called when a player receives an exchange request from another player. API-Since: 7.0
      • playerReceivedTurnEventForMatchDidBecomeActive

        default void playerReceivedTurnEventForMatchDidBecomeActive​(@NotNull
                                                                    @NotNull GKPlayer player,
                                                                    @NotNull
                                                                    @NotNull GKTurnBasedMatch match,
                                                                    boolean didBecomeActive)
        called when it becomes this player's turn. It also gets called under the following conditions: the player's turn has a timeout and it is about to expire. the player accepts an invite from another player. when the game is running it will additionally recieve turn events for the following: turn was passed to another player another player saved the match data Because of this the app needs to be prepared to handle this even while the player is taking a turn in an existing match. The boolean indicates whether this event launched or brought to forground the app. API-Since: 7.0
      • playerWantsToQuitMatch

        default void playerWantsToQuitMatch​(@NotNull
                                            @NotNull GKPlayer player,
                                            @NotNull
                                            @NotNull GKTurnBasedMatch match)
        Called when a player chooses to quit a match and that player has the current turn. The developer should call participantQuitInTurnWithOutcome:nextParticipants:turnTimeout:matchData:completionHandler: on the match passing in appropriate values. They can also update matchOutcome for other players as appropriate. API-Since: 9.0