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


@interface GKVoiceChatService : NSObject


Before you can use voice chat, your application must configure an audio session that allows for both play and recording (kAudioSessionCategory_PlayAndRecord). For more information on audio sessions, see Audio Session Programming Guide.

The voice chat service uses a client implemented by your application to find and connect to other participants. Each participant in the chat is identified by a unique participant identifier string. The client provides a participant identifier for the local user and translates other participant identifiers into connections to other users. The format and mechanism used to translate participant identifiers into network connections is defined by the client. See Game Center Programming Guide for a more complete discussion.

Your application can configure the voice chat service to control the volume level of both local and remote participants and to detect when someone is speaking.

To use the voice chat service, your application retrieves the default service and attaches a client to it, then either connects to another participant or waits for them to start a connection.


Determining Whether Voice Chat Is Available

+ isVoIPAllowed

Returns whether voice chat is allowed to be used on the device.

Getting the Shared Voice Chat Service

+ defaultVoiceChatService

Retrieves the singleton chat service.

Setting the Client


An object that the voice chat service uses to communicate with remote participants.

Establishing a Voice Chat

- startVoiceChatWithParticipantID:error:

Sends a request to another participant to join the voice chat.

Adjusting Audio Properties


A Boolean value that determines whether the user’s microphone is muted.


A float that scales the volume of all remote participants.

Monitoring the Audio Level


A Boolean value that indicates whether the microphone’s sound level is being monitored.


The volume, in decibels (db), being received by the microphone.


A Boolean value that indicates whether the voice level of remote participants is monitored.


The volume, in decibels (db), being received from all other participants.

Ending a Voice Chat

- stopVoiceChatWithParticipantID:

Ends a previously established voice chat.

Methods Called by the Client

- acceptCallID:error:

Accepts a request from a remote user to establish a voice chat.

- denyCallID:

Rejects a request to establish a voice chat.

- receivedData:fromParticipantID:

Called by the client to deliver new data received from a remote participant.

- receivedRealTimeData:fromParticipantID:

Called by the client to deliver voice data received from a remote participant..


Voice Chat Service Error Domain

The GKVoiceChatService error domain.


Error codes for the GKVoiceChatService error domain.


Inherits From

See Also

Voice Chat


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