NowPushSDK 클래스 - Android

  • 릴리스 버전: Australia
  • 업데이트 날짜 2026년 03월 12일
  • 소요 시간: 1분
  • NowPushSDK 클래스는 원치 않는 (푸시) 알림을 디바이스에 보낼 수 있는 NowPushService를 만드는 데 필요한 함수를 Android 제공합니다.

    NowPushSDK - makePushService(instanceURL: URL)

    NowPush 서비스를 작성합니다.

    표 1. 매개변수
    이름 유형 설명
    인스턴스URL URL NowPushService가 상호작용해야 하는 인스턴스의 ServiceNow URL입니다.
    표 2. 반환
    유형 설명
    결과<NowPushService> Kotlin Result 객체에 래핑된 NowPushService 객체입니다.

    이 예는 푸시 서비스를 만들기 위해 makePushService() 메서드를 설정하는 방법을 보여줍니다.

    private var nowPushService: NowPushService? = null
    
    /**
      * Create the NowPushService once in the lifetime of the application inside the Application
      * class or another manager class that will be injected into other classes via dagger/hilt.
      * NowPushService should be created after initializing the NowSDK.
      */
    suspend fun getNowPushService(): NowPushService? {
      if (nowPushService != null) return nowPushService
    
      return NowPushSDK.makePushService(URL("https://instance-name.service-now.com")).getOrThrow()
        .also { this.nowPushService = it }
    }