NowPush API - iOS

  • 릴리스 버전: Australia
  • 업데이트 날짜 2026년 03월 12일
  • 소요 시간: 3분
  • The NowPush API is a top-level global API that enables users to instantiate a NowPush service instance.

    NowPush - makePushService(instanceUrl: URL)

    Creates an instance of NowChatService with the specified configuration.

    표 1. Parameters
    Name Type Description
    instanceUrl URL URL of the ServiceNow instance providing push notification services.
    표 2. Returns
    Type Description
    AnyPublisher<Now​Push​Service, NowServiceError> If successful, returns an initialized Now​Push​Service object. If it fails, returns a NowServiceError object.

    This example shows how to create an instance of NowChatService.

    func setup(with instanceURL: URL) -> AnyPublisher<NowService, ConfigurationError> {
      NowPush.makePushService(instanceUrl: instanceURL)
        .mapError { .sdkError($0) }
        .map { $0 as NowService }
        .eraseToAnyPublisher()
    }

    NowPush - makePushService(instanceUrl: URL, completion: @escaping ((Result<NowPushService, NowServiceError>) -> Void))

    Creates an instance of NowPushService with the specified configuration, and once complete, calls the specified completion handler.

    표 3. Parameters
    Name Type Description
    instanceUrl URL URL of the ServiceNow instance providing push notification services.
    completion @escaping ((Result<Now​Push​Service, Now​Service​Error>) -> Void) Completion handler that is called containing either an initialized NowPushService instance or a NowServiceError indicating why the initialization failed.
    표 4. Returns
    Type Description
    None

    This example shows how to create an instance of NowPushService.

    static func setup(with instanceURL: URL,completion: @escaping
      (Result<NowPushService, NowServiceError>) → Void) {
        NowPush.makePushService(instanceUrl: instanceURL} {result in
          switch result {
          case .success(letpushService):
            completion(.success(pushService))
          case .failure(let error):
            completion(.failure(eror))
          }
        }
      }