Instance Method

sendData:toPlayers:withDataMode:error:

Transmits data to a list of connected players.

Declaration

- (BOOL)sendData:(NSData *)data toPlayers:(NSArray<NSString *> *)playerIDs withDataMode:(GKMatchSendDataMode)mode error:(NSError * _Nullable *)error;

Parameters

data

The bytes to be sent.

playerIDs

An array of NSString objects containing the identifier strings for the list of players who should receive the data.

mode

The mechanism used to send the data.

error

If the data could not be queued, on return, this parameter holds an NSError object describing the error.

Return Value

YES if the data was successfully queued for transmission; NO if the match was unable to queue the data.

Discussion

The match queues the data and transmits it when the network becomes available.

See Also

Deprecated Methods and Properties

- chooseBestHostPlayerWithCompletionHandler:

Determines the best player in the game to act as the server for a client-server match.

Deprecated
playerIDs

An array of NSString objects containing the player identifiers for remote players in the match.

Deprecated