---
sourceDocument: Australia API Reference
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/api-reference

 Release :

    - australia

ft:locale :

    - en-US

ft:publication_title :

    - Australia API Reference

ft:clusterId :

    - crapiref

bundleId :

    - crapiref

workflow :

    - Creator


---

# NowVoiceService class - iOS

# NowVoiceService class - iOS {#ariaid-title1}

Release version: Australia  
Updated July 14, 2026  
![](https://www.servicenow.com/docs/portal-asset/ico-clock) 4 minutes to read  
The NowVoiceService class manages voice agent sessions for a single
ServiceNow instance.  
Note:  
Initialize a NowVoiceService by calling [NowVoice - makeVoiceService(instanceUrl: URL) async throws](https://servicenow-prod.fluidtopics.net/417Kga_bz7s4G4N2FyGC9Q#NVoice-makeVoiceService_S "Creates an instance of NowVoiceService for the specified ServiceNow instance.").  
{#NowVoiceServiceiOSAPI__table_vx2_klw_nv1__entry__3}

| Name | Type | Description |
|-|-|-|
| configuration | [NowServiceConfiguration](https://servicenow-prod.fluidtopics.net/22nfV2bE7dtralPVv1~VTA#NowServiceConfigurationiOSStruct "The NowServiceConfiguration structure defines configuration information for a feature service.") | The service configuration for the ServiceNow instance. |
| configurations | Array of [NowVoiceEndpoints](https://servicenow-prod.fluidtopics.net/m55d7vaox0r2Gr3AEw73tQ "Describes a voice agent endpoint.") | List of available voice endpoint configurations retrieved from the instance. |
| isMuted | Bool | Flag that indicates the microphone mute state for the current call. Setting this property has no effect if no call is currently active. Valid values: * true: The microphone is muted. * false: The microphone is unmuted or no call is active. {#NowVoiceServiceiOSAPI__ul_png_bdk_jkc} |
| voiceEnabled | Bool | Flag that indicates whether voice is enabled on the instance. Valid values: * true: Voice is enabled. * false: Voice is turned off. {#NowVoiceServiceiOSAPI__ul_cq2_w1h_yjc} Always `true` after a NowVoiceService is successfully initialized with [makeVoiceService(instanceUrl:)](https://servicenow-prod.fluidtopics.net/417Kga_bz7s4G4N2FyGC9Q#NVoice-makeVoiceService_S "Creates an instance of NowVoiceService for the specified ServiceNow instance."). |
[Table 1. Properties]

{#NowVoiceServiceiOSAPI__table_vx2_klw_nv1}

## NowVoiceService - endCall() {#ariaid-title2}

Ends the current voice call.
Has no effect if no call is active.
{#NVoiceServ-endCall__table_cs5_2ck_jkc__entry__3}

| Name | Type | Description |
|-|-|-|
| None |   |   |
[Table 2. Parameters]

{#NVoiceServ-endCall__table_cs5_2ck_jkc} {#NVoiceServ-endCall__table_qft_qzv_nva8__entry__2}

| Type | Description |
|-|-|
| None |   |
[Table 3. Returns]

{#NVoiceServ-endCall__table_qft_qzv_nva8}  
The following code example shows how to call this function.

    let voiceService = try? await NowVoice.makeVoiceService(instanceUrl: instanceUrl)
    let endpoint = voiceService?.configurations.first

    if let voiceService, let endpoint {
        if let vc = try? await voiceService.startVoice(endpoint: endpoint, theme: theme) {
            vc.modalPresentationStyle = .fullScreen
            present(vc, animated: true)
        }
    }

    // End a call on timeout, navigation, or from a custom hang-up button
    voiceService?.endCall()

## NowVoiceService - hasActiveCall() {#ariaid-title3}

Checks whether there is a currently active voice call.
{#NVoiceServ-hasActiveCall__table_cs5_2ck_jkc__entry__3}

| Name | Type | Description |
|-|-|-|
| None |   |   |
[Table 4. Parameters]

{#NVoiceServ-hasActiveCall__table_cs5_2ck_jkc} {#NVoiceServ-hasActiveCall__table_qft_qzv_nva8__entry__2}

| Type | Description |
|-|-|
| Boolean | Flag that indicates whether there is an active voice call. Valid values: * true: There is an active voice call. * false: There isn't an active voice call. {#NVoiceServ-hasActiveCall__ul_qs4_pbk_jkc} |
[Table 5. Returns]

{#NVoiceServ-hasActiveCall__table_qft_qzv_nva8}  
The following code example shows how to call this function.

    let voiceService = try? await NowVoice.makeVoiceService(instanceUrl: instanceUrl)
    let endpoint = voiceService?.configurations.first

    if let voiceService, let endpoint {
        if let vc = try? await voiceService.startVoice(endpoint: endpoint, theme: theme) {
            vc.modalPresentationStyle = .fullScreen
            present(vc, animated: true)
        }
    }

    // Guard UI state or prevent starting a second call
    if voiceService?.hasActiveCall() == true {
        // A voice call is currently in progress
    }

## NowVoiceService - startVoice(endpoint: NowVoiceEndpoint, uiConfiguration: NowVoiceUIConfiguration, callbacks: NowVoiceCallbacks, theme: NowVoiceThemeable) async throws {#ariaid-title4}

Creates a UIViewController containing the voice agent UI, ready to be presented in a modal.
The UIViewController manages the full voice session lifecycle, including teardown on dismissal.

This function fetches an OAuth access token automatically before launching the voice UI.
{#NVoiceServ-startVoice_O_O_O_O__table_pft_qzv_nvo2__entry__3}

| Name | Type | Description |
|-|-|-|
| endpoint | [NowVoiceEndpoint](https://servicenow-prod.fluidtopics.net/m55d7vaox0r2Gr3AEw73tQ "Describes a voice agent endpoint.") | The voice agent channel to connect to. Obtain from [`NowVoiceService.configurations`](https://servicenow-prod.fluidtopics.net/s_OvVdDJDVew6swvY7zHBA#NowVoiceServiceiOSAPI "The NowVoiceService class manages voice agent sessions for a single ServiceNow instance."). Endpoints are retrieved from your ServiceNow instance's Mobile SDK settings. |
| uiConfiguration | [NowVoiceUIConfiguration](https://servicenow-prod.fluidtopics.net/qISbY0cot76Z3Si6Upxb7w#NowVoiceUIConfigiOSStruct "Specifies presentation options for the voice agent UI.") | Optional. Presentation options for the voice agent UI. If omitted, uses the default values for NowVoiceUIConfiguration. |
| callbacks | [NowVoiceCallbacks](https://servicenow-prod.fluidtopics.net/It4LuxELDVwrTKjmLLuGjg#NowVoiceCallbacksiOSStruct "Specifies callbacks for voice session lifecycle and content events.") | Optional. Callbacks for voice session events. If omitted, events are silently ignored. |
| theme | [NowVoiceThemeable](https://servicenow-prod.fluidtopics.net/t_MbAcjx8gsbDauJxoWyuA "Sets the colors to apply to NowVoice UI elements.") | Optional. The visual theme applied to the voice UI. Default: [`NowVoiceDefaultTheme`](https://servicenow-prod.fluidtopics.net/03n1e_DysVRF5a0ai~ZzQQ#NVoiceDefThemeiOSStruct "The default implementation of NowVoiceThemeable.") |
[Table 6. Parameters]

{#NVoiceServ-startVoice_O_O_O_O__table_pft_qzv_nvo2} {#NVoiceServ-startVoice_O_O_O_O__table_qft_qzv_nvo2__entry__2}

| Type | Description |
|-|-|
| UIViewController | A UIViewController containing the full-screen voice agent interface. Present it in a modal. Set `modalPresentationStyle = .fullScreen` for the intended experience. |
[Table 7. Returns]

{#NVoiceServ-startVoice_O_O_O_O__table_qft_qzv_nvo2}  
The following code example shows how to call this function.

    import NowVoice

    let instanceUrl = URL(string: "https://your-instance.service-now.com")!

    let voiceService = try? await NowVoice.makeVoiceService(instanceUrl: instanceUrl)

    guard let voiceService, let endpoint = voiceService.configurations.first else {
        // Either the service failed to initialize, or no voice endpoints are configured.
        return
    }

    // Launch the voice agent UI
    let vc = try await voiceService.startVoice(
        endpoint: endpoint,
        uiConfiguration: NowVoiceUIConfiguration(
            hidesPostCallTranscript: false,
            shouldBlockTranscriptSharing: false
        ),
        callbacks: NowVoiceCallbacks(
            onMuteStateChanged: { isMuted in
                // Update your UI to reflect the current mute state.
                print("Microphone muted: \(isMuted)")
            },
            onMessageReceived: { message in
                // Receive real-time transcript messages during the session.
                print("[\(message.role)]: \(message.content)")
            },
            onCallEnded: { conversationId, error, endedFromCallKitUI in
                // Called when the voice session ends.
                if let error {
                    print("Session ended with error: \(error)")
                } else {
                    print("Session complete. Conversation ID: \(conversationId ?? "unknown")")
                }
            },
            onCallMinimized: {
                // Called when the voice UI is minimized.
                print("Voice chat is minimized")
            }
        ),
        theme: NowVoiceDefaultTheme()
    )

    //Present the voice agent UI in a full-screen modal
    vc.modalPresentationStyle = .fullScreen
    present(vc, animated: true)

## NowVoiceService - toggleMute() {#ariaid-title5}

Toggles the microphone mute state of the current call.
{#NVoiceServ-toggleMute__table_cs5_2ck_jkc__entry__3}

| Name | Type | Description |
|-|-|-|
| None |   |   |
[Table 8. Parameters]

{#NVoiceServ-toggleMute__table_cs5_2ck_jkc} {#NVoiceServ-toggleMute__table_qft_qzv_nva7__entry__2}

| Type | Description |
|-|-|
| Bool | Flag that indicates the new microphone mute state for the current call. Valid values: * true: The microphone is now muted. * false: The microphone is now unmuted or no call is active. {#NVoiceServ-toggleMute__ul_png_bdk_jkc} |
[Table 9. Returns]

{#NVoiceServ-toggleMute__table_qft_qzv_nva7}  
The following code example shows how to call this function.

    let voiceService = try? await NowVoice.makeVoiceService(instanceUrl: instanceUrl)

    let endpoint = voiceService?.configurations.first

    if let voiceService, let endpoint {
        if let vc = try? await voiceService.startVoice(endpoint: endpoint, theme: theme) {
            vc.modalPresentationStyle = .fullScreen
            present(vc, animated: true)
        }
    }

    // Wire to a custom mute button or auto-mute on backgrounding
    voiceService?.toggleMute()

    // Check mute state to update a custom mute button icon
    let muted = voiceService?.isMuted ?? false

## NowVoiceService - updateTheme(theme: NowVoiceThemeable) {#ariaid-title6}

Updates the visual theme of the currently active voice UI.
This function has no effect if no voice session is currently active. To apply a visual theme at voice session launch, provide a theme when calling [startVoice(endpoint:uiConfiguration:callbacks:theme:)](https://servicenow-prod.fluidtopics.net/s_OvVdDJDVew6swvY7zHBA#NVoiceServ-startVoice_O_O_O_O "Creates a UIViewController containing the voice agent UI, ready to be presented in a modal.").
{#NVoiceServ-updateTheme_O__table_pft_qzv_nvo3__entry__3}

| Name | Type | Description |
|-|-|-|
| theme | NowVoiceThemeable | The theme to apply to the active voice UI. |
[Table 10. Parameters]

{#NVoiceServ-updateTheme_O__table_pft_qzv_nvo3} {#NVoiceServ-updateTheme_O__table_qft_qzv_nvo2__entry__2}

| Type | Description |
|-|-|
| None |   |
[Table 11. Returns]

{#NVoiceServ-updateTheme_O__table_qft_qzv_nvo2}  
The following code example updates the visual theme of the currently active voice UI.

    import NowVoice

    let instanceUrl = URL(string: "https://your-instance.service-now.com")!
    let voiceService = try? await NowVoice.makeVoiceService(instanceUrl: instanceUrl)

    struct MyVoiceTheme: NowVoiceThemeable { var color: NowUIColoring = MyAppColors()}

    // Update the theme while a voice session is active
    voiceService?.updateTheme(theme: MyVoiceTheme())


