---
sourceDocument: 호주 API 참조
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/ko-KR/api-reference

 Release :

    - australia

ft:locale :

    - ko-KR

ft:publication_title :

    - 호주 API 참조

ft:clusterId :

    - crapiref

bundleId :

    - crapiref

workflow :

    - Creator


---

# NowAnalyticsServiceDelegate 프로토콜 - iOS

# NowAnalyticsServiceDelegate 프로토콜 - iOS {#ariaid-title1}

* 릴리스 버전: Australia
* 
* 업데이트 날짜 2026년 03월 12일
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 소요 시간: 12분

NowAnalyticsServiceDelegate 프로토콜은 사용자 세션의 시작 및 종료 및 화면 변경 탐지에 대한 정보를 제공하는 콜백 함수를 제공합니다.

## NowAnalyticsServiceDelegate - nowAnalyticsDidDetectScreen( _ sessionId: String) {#ariaid-title2}

화면 변경이 감지되면 알립니다. 탐색 모음에서 화면 이름이 감지됩니다. 이것이 가능하지 않은 경우 viewController 서브클래스 이름입니다.
{#NAnServDel-nowAnalDidDetectScreen_S__table_ljr_3bb_kqb__entry__3}

| 이름 | 유형 | 설명 |
|-|-|-|
| 스크린 이름 | 문자열 | 변경 여부를 탐지할 화면의 이름입니다. |
[표 1. 매개변수]

{#NAnServDel-nowAnalDidDetectScreen_S__table_ljr_3bb_kqb} {#NAnServDel-nowAnalDidDetectScreen_S__table_mjr_3bb_kqb__entry__2}

| 유형 | 설명 |
|-|-|
| 문자열 | 전달된 screenName을 재정의하는 데 사용할 사용자 지정 이름입니다. |
[표 2. 반환]

{#NAnServDel-nowAnalDidDetectScreen_S__table_mjr_3bb_kqb}  
이 예시에서는 NowAnalyticsServiceDelegate에 대한 대리자 클래스를 정의하는 방법을 보여줍니다.

    import NowAnalytics

    // Initialize the Analytics SDK
    NowAnalytics.configure(for: URL(string: "https://my.instance.service-now.com")!)

    // Define a delegate class for NowAnalyticsServiceDelegate
    class NowAnalyticsDelegate: NowAnalytics.NowAnalyticsServiceDelegate {
      func nowAnalyticsSessionShouldStart() -> Bool {
        // Session is about to start, return true to allow session to start
        return true
      }

      func nowAnalyticsSessionDidStart(_ sessionId: String) {
        // Session was started
      }

      func nowAnalyticsSessionShouldEnd(_ sessionId: String) -> Bool {
        // Session is about to end, return true to allow session to end
        return true
      }

      func nowAnalyticsSessionDidEnd(_ sessionId: String) {
        // Session was ended
      }

      func nowAnalyticsDidDetectScreen(_ screenName: String) -> String? {
        // Example of skipping specific screen detection
        if (screenName == "LoginViewController") {
          return nil
        }

        // Example of appending a prefix for every screen detected
        return "MyApp_" + screenName
      }
    }

    // Register delegate
    private var analyticsDelegate = NowAnalyticsDelegate()  // Keep ref of delegate
    NowAnalytics.sharedAnalyticsService.setDelegate(analyticsDelegate)

## NowAnalyticsServiceDelegate - nowAnalyticsSessionDidEnd( _ sessionId: String) {#ariaid-title3}

지정된 세션이 종료되면 알립니다.
지정된 세션이 실제로 종료될 때 호출되는 콜백 함수입니다.
{#NAnServDel-nowAnalSessionDidEnd_S__table_hnt_b2v_1qb__entry__3}

| 이름 | 유형 | 설명 |
|-|-|-|
| sessionId | 문자열 | 확인할 세션의 고유 식별자입니다. |
[표 3. 매개변수]

{#NAnServDel-nowAnalSessionDidEnd_S__table_hnt_b2v_1qb} {#NAnServDel-nowAnalSessionDidEnd_S__table_int_b2v_1qb__entry__2}

| 유형 | 설명 |
|-|-|
| 없음 |   |
[표 4. 반환]

{#NAnServDel-nowAnalSessionDidEnd_S__table_int_b2v_1qb}  
이 예시에서는 NowAnalyticsServiceDelegate에 대한 대리자 클래스를 정의하는 방법을 보여줍니다.

    import NowAnalytics

    // Initialize the Analytics SDK
    NowAnalytics.configure(for: URL(string: "https://my.instance.service-now.com")!)

    // Define a delegate class for NowAnalyticsServiceDelegate
    class NowAnalyticsDelegate: NowAnalytics.NowAnalyticsServiceDelegate {
      func nowAnalyticsSessionShouldStart() -> Bool {
        // Session is about to start, return true to allow session to start
        return true
      }

      func nowAnalyticsSessionDidStart(_ sessionId: String) {
        // Session was started
      }

      func nowAnalyticsSessionShouldEnd(_ sessionId: String) -> Bool {
        // Session is about to end, return true to allow session to end
        return true
      }

      func nowAnalyticsSessionDidEnd(_ sessionId: String) {
        // Session was ended
      }

      func nowAnalyticsDidDetectScreen(_ screenName: String) -> String? {
        // Example of skipping specific screen detection
        if (screenName == "LoginViewController") {
          return nil
        }

        // Example of appending a prefix for every screen detected
        return "MyApp_" + screenName
      }
    }

    // Register delegate
    private var analyticsDelegate = NowAnalyticsDelegate()  // Keep ref of delegate
    NowAnalytics.sharedAnalyticsService.setDelegate(analyticsDelegate)

## NowAnalyticsServiceDelegate - nowAnalyticsSessionDidStart( _ sessionId: String) {#ariaid-title4}

지정된 세션이 시작되면 알립니다.
지정된 세션이 실제로 시작될 때 호출되는 콜백 함수입니다.
{#NAnServDel-nowAnalSessionDidStart_S__table_ntx_m2v_1qb__entry__3}

| 이름 | 유형 | 설명 |
|-|-|-|
| sessionId | 문자열 | 확인할 세션의 고유 식별자입니다. |
[표 5. 매개변수]

{#NAnServDel-nowAnalSessionDidStart_S__table_ntx_m2v_1qb} {#NAnServDel-nowAnalSessionDidStart_S__table_otx_m2v_1qb__entry__2}

| 유형 | 설명 |
|-|-|
| 부울 | 세션이 시작되고 있음을 나타내는 플래그입니다. 유효한 값은 다음과 같습니다. * true: 세션이 시작됩니다. * false: 세션이 시작되지 않습니다. |
[표 6. 반환]

{#NAnServDel-nowAnalSessionDidStart_S__table_otx_m2v_1qb}  
이 예시에서는 NowAnalyticsServiceDelegate에 대한 대리자 클래스를 정의하는 방법을 보여줍니다.

    import NowAnalytics

    // Initialize the Analytics SDK
    NowAnalytics.configure(for: URL(string: "https://my.instance.service-now.com")!)

    // Define a delegate class for NowAnalyticsServiceDelegate
    class NowAnalyticsDelegate: NowAnalytics.NowAnalyticsServiceDelegate {
      func nowAnalyticsSessionShouldStart() -> Bool {
        // Session is about to start, return true to allow session to start
        return true
      }

      func nowAnalyticsSessionDidStart(_ sessionId: String) {
        // Session was started
      }

      func nowAnalyticsSessionShouldEnd(_ sessionId: String) -> Bool {
        // Session is about to end, return true to allow session to end
        return true
      }

      func nowAnalyticsSessionDidEnd(_ sessionId: String) {
        // Session was ended
      }

      func nowAnalyticsDidDetectScreen(_ screenName: String) -> String? {
        // Example of skipping specific screen detection
        if (screenName == "LoginViewController") {
          return nil
        }

        // Example of appending a prefix for every screen detected
        return "MyApp_" + screenName
      }
    }

    // Register delegate
    private var analyticsDelegate = NowAnalyticsDelegate()  // Keep ref of delegate
    NowAnalytics.sharedAnalyticsService.setDelegate(analyticsDelegate)

## NowAnalyticsServiceDelegate - nowAnalyticsSessionShouldEnd( _ sessionId: String) {#ariaid-title5}

지정된 세션 이 종료될 때 알립니다.
지정된 세션이 종료되려고 할 때 호출되는 콜백 함수입니다.
{#NAnServDel-nowAnalSessShouldEnd_S__table_lrd_pcv_1qb__entry__3}

| 이름 | 유형 | 설명 |
|-|-|-|
| sessionId | 문자열 | 확인할 세션의 고유 식별자입니다. |
[표 7. 매개변수]

{#NAnServDel-nowAnalSessShouldEnd_S__table_lrd_pcv_1qb} {#NAnServDel-nowAnalSessShouldEnd_S__table_mrd_pcv_1qb__entry__2}

| 유형 | 설명 |
|-|-|
| 부울 | 세션이 종료되었음을 나타내는 플래그입니다. 유효한 값은 다음과 같습니다. * true: 세션이 종료 중입니다. * false: 세션이 종료되지 않음 |
[표 8. 반환]

{#NAnServDel-nowAnalSessShouldEnd_S__table_mrd_pcv_1qb}  
이 예시에서는 NowAnalyticsServiceDelegate에 대한 대리자 클래스를 정의하는 방법을 보여줍니다.

    import NowAnalytics

    // Initialize the Analytics SDK
    NowAnalytics.configure(for: URL(string: "https://my.instance.service-now.com")!)

    // Define a delegate class for NowAnalyticsServiceDelegate
    class NowAnalyticsDelegate: NowAnalytics.NowAnalyticsServiceDelegate {
      func nowAnalyticsSessionShouldStart() -> Bool {
        // Session is about to start, return true to allow session to start
        return true
      }

      func nowAnalyticsSessionDidStart(_ sessionId: String) {
        // Session was started
      }

      func nowAnalyticsSessionShouldEnd(_ sessionId: String) -> Bool {
        // Session is about to end, return true to allow session to end
        return true
      }

      func nowAnalyticsSessionDidEnd(_ sessionId: String) {
        // Session was ended
      }

      func nowAnalyticsDidDetectScreen(_ screenName: String) -> String? {
        // Example of skipping specific screen detection
        if (screenName == "LoginViewController") {
          return nil
        }

        // Example of appending a prefix for every screen detected
        return "MyApp_" + screenName
      }
    }

    // Register delegate
    private var analyticsDelegate = NowAnalyticsDelegate()  // Keep ref of delegate
    NowAnalytics.sharedAnalyticsService.setDelegate(analyticsDelegate)

## NowAnalyticsServiceDelegate - nowAnalyticsSessionShouldStart( _ sessionId: 문자열) {#ariaid-title6}

지정된 세션이 곧 시작되는지 여부를 알립니다.
지정된 세션이 시작되려고 할 때 호출되는 콜백 함수입니다.
{#NAnServDel-nowAnalSessShouldStart_S__table_ojw_z1v_1qb__entry__3}

| 이름 | 유형 | 설명 |
|-|-|-|
| sessionId | 문자열 | 확인할 세션의 고유 식별자입니다. |
[표 9. 매개변수]

{#NAnServDel-nowAnalSessShouldStart_S__table_ojw_z1v_1qb} {#NAnServDel-nowAnalSessShouldStart_S__table_pjw_z1v_1qb__entry__2}

| 유형 | 설명 |
|-|-|
| 없음 |   |
[표 10. 반환]

{#NAnServDel-nowAnalSessShouldStart_S__table_pjw_z1v_1qb}  
이 예시에서는 NowAnalyticsServiceDelegate에 대한 대리자 클래스를 정의하는 방법을 보여줍니다.

    import NowAnalytics

    // Initialize the Analytics SDK
    NowAnalytics.configure(for: URL(string: "https://my.instance.service-now.com")!)

    // Define a delegate class for NowAnalyticsServiceDelegate
    class NowAnalyticsDelegate: NowAnalytics.NowAnalyticsServiceDelegate {
      func nowAnalyticsSessionShouldStart() -> Bool {
        // Session is about to start, return true to allow session to start
        return true
      }

      func nowAnalyticsSessionDidStart(_ sessionId: String) {
        // Session was started
      }

      func nowAnalyticsSessionShouldEnd(_ sessionId: String) -> Bool {
        // Session is about to end, return true to allow session to end
        return true
      }

      func nowAnalyticsSessionDidEnd(_ sessionId: String) {
        // Session was ended
      }

      func nowAnalyticsDidDetectScreen(_ screenName: String) -> String? {
        // Example of skipping specific screen detection
        if (screenName == "LoginViewController") {
          return nil
        }

        // Example of appending a prefix for every screen detected
        return "MyApp_" + screenName
      }
    }

    // Register delegate
    private var analyticsDelegate = NowAnalyticsDelegate()  // Keep ref of delegate
    NowAnalytics.sharedAnalyticsService.setDelegate(analyticsDelegate)


