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

 Release :

    - xanadu

ft:locale :

    - en-US

ft:publication_title :

    - Xanadu API Reference

ft:clusterId :

    - crapiref

bundleId :

    - crapiref

workflow :

    - Creator


---

# NowPush API - iOS

# NowPush API - iOS {#ariaid-title1}

* Release version: Xanadu
* 
* Updated August 1, 2024
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 1 minute to read

The NowPush API is a top-level global API that enables users to
instantiate a NowPush service instance.

## NowPush - makePushService(instanceUrl: URL) {#ariaid-title2}

Creates an instance of `NowChatService` with the specified
configuration.
{#NPush-makePushService_S__table_zgd_zwn_trb__entry__3}

| Name | Type | Description |
|-|-|-|
| instanceUrl | URL | URL of the ServiceNow instance providing push notification services. |
[Table 1. Parameters]

{#NPush-makePushService_S__table_zgd_zwn_trb} {#NPush-makePushService_S__table_ahd_zwn_trb__entry__2}

| Type | Description |
|-|-|
| AnyPublisher\<[Now​Push​Service](https://servicenow-prod.fluidtopics.net/bhsSlMGEzTRYOyP_xlw7JA#NowPushServiceiOSAPI "The NowPushService class provides functions that enable interaction with the Push Notification service."), NowServiceError\> | If successful, returns an initialized [Now​Push​Service](https://servicenow-prod.fluidtopics.net/bhsSlMGEzTRYOyP_xlw7JA#NowPushServiceiOSAPI "The NowPushService class provides functions that enable interaction with the Push Notification service.") object. If it fails, returns a NowServiceError object. |
[Table 2. Returns]

{#NPush-makePushService_S__table_ahd_zwn_trb}  
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)) {#ariaid-title3}

Creates an instance of `NowPushService` with the specified
configuration, and once complete, calls the specified completion handler.
{#NPush-makePushService_S_O__table_vsv_f5n_trb__entry__3}

| Name | Type | Description |
|-|-|-|
| instanceUrl | URL | URL of the ServiceNow instance providing push notification services. |
| completion | @escaping ((Result\<[Now​Push​Service](https://servicenow-prod.fluidtopics.net/bhsSlMGEzTRYOyP_xlw7JA#NowPushServiceiOSAPI "The NowPushService class provides functions that enable interaction with the Push Notification service."), Now​Service​Error\>) -\> Void) | Completion handler that is called containing either an initialized `NowPushService` instance or a `NowServiceError` indicating why the initialization failed. |
[Table 3. Parameters]

{#NPush-makePushService_S_O__table_vsv_f5n_trb} {#NPush-makePushService_S_O__table_wsv_f5n_trb__entry__2}

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

{#NPush-makePushService_S_O__table_wsv_f5n_trb}  
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))
          }
        }
      }


