Skip to content
Release: Australia · Updated: 2026-03-12 · Official documentation · View source

NowPushSDK class- Android

The NowPushSDK class provides the function necessary to create a NowPushService that enables the sending of unsolicited (push) notifications to Android devices.

Parent Topic:Mobile SDK - Android

NowPushSDK - makePushService(instanceURL: URL)

Creates a NowPush service.

NameTypeDescription
instanceURLURLURL of the ServiceNow instance that the NowPushService should interact with.
TypeDescription
Result<NowPushService>NowPushService object wrapped in a Kotlin Result object.

This example shows how to setup to makePushService() method to create the Push Service.

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 }
}