Protocol

GKVoiceChatClient

The GKVoiceChatClient protocol is implemented to control the behavior of the GKVoiceChatService object. The voice chat client has a number of responsibilities:

Declaration

protocol GKVoiceChatClient

Overview

  • Provides a network connection that the voice chat service uses to send and receive configuration data with other participants. If this network connection is shared with other application data, the client must also disambiguate between chat configuration data and application data.

  • Provides a participant ID that identifies the user to remote participants in the chat.

  • Defines how a remote user’s participant ID translates into a network connection to that user.

  • Accepts or rejects requests from remote participants to join the voice chat.

Topics

Getting Information about the Participant

func participantID() -> String

Returns a string that uniquely identifies the local user.

Required.

Sending data to other participants

func voiceChatService(GKVoiceChatService, send: Data, toParticipantID: String)

A request for the client to send data to a participant.

Required.

func voiceChatService(GKVoiceChatService, sendRealTime: Data, toParticipantID: String)

Asks the client to send data to a participant that must get there quickly.

Accepting Invitations from Remote Participants

func voiceChatService(GKVoiceChatService, didReceiveInvitationFromParticipantID: String, callID: Int)

Asks the client to accept or reject an invitation from a remote participant.

Responding to Changes in Other Participants

func voiceChatService(GKVoiceChatService, didStartWithParticipantID: String)

Received by the client when a voice chat with another participant is established.

func voiceChatService(GKVoiceChatService, didNotStartWithParticipantID: String, error: Error?)

Received by the client when an attempt to establish a voice chat with another participant failed.

func voiceChatService(GKVoiceChatService, didStopWithParticipantID: String, error: Error?)

Received by the client when a previously established voice chat has ended.

Relationships

Inherits From

See Also

Voice Chat

class GKVoiceChatService

The GKVoiceChatService class allows your application to connect two iOS devices into a voice chat.

Deprecated