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


---

# NowWebSDK class - Android

# NowWebSDK class - Android {#ariaid-title1}

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

The NowWebSDK class provides a single function that enables you to
load web pages hosted on your ServiceNow instance in a native web view and
Cabrillo. It automatically handles user authentication and session management instead of forcing
users to log into the instance through a login web page.

## NowWebSDK - makeWebService(instanceURL: URL, nowWebSdkCallbacks: NowWebViewServiceDelegate? = null) {#ariaid-title2}

Creates a NowWeb service.
{#NWebSDK-makeWebService_S_S_S_S__table_ttk_2dd_npb__entry__3}

| Name | Type | Description |
|-|-|-|
| instanceURL | [URL](https://developer.android.com/reference/kotlin/java/net/URL.html) | URL of the ServiceNow instance to access. For example, `"https://instance.servicenow.com"` |
| nowWebSdkCallbacks | NowWebViewServiceDelegate | Callbacks for the host application to configure NowWebService. |
[Table 1. Parameters]

{#NWebSDK-makeWebService_S_S_S_S__table_ttk_2dd_npb} {#NWebSDK-makeWebService_S_S_S_S__table_utk_2dd_npb__entry__2}

| Type | Description |
|-|-|
| Result\<NowWebService\> | NowWebService object wrapped in a [Kotlin Result object](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-result/). |
[Table 2. Returns]

{#NWebSDK-makeWebService_S_S_S_S__table_utk_2dd_npb}  
The following code example shows how to call this function.

     private var nowWebService: NowWebService? = null

    /**
      * Create the NowWebService 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.
      * NowWebService should be created after initializing the NowSDK.
      */
    suspend fun getNowWebService(): NowWebService? {
      if (nowWebService != null) return nowWebService

      return NowWebSDK.makeWebService(URL("https://instance-name.service-now.com"), object :
        NowWebViewServiceDelegate {
        override fun flowEnded(activity: Activity, flowName: String?) {
          Log.i("NowWebSdk", "flow ended")
        }

        override fun requestedDismissal(activity: Activity) {
          Log.i("NebWebSdk", "screen should be dismissed")
        }

        override fun navigationFailed(activity: Activity, error: String) {
          Log.i("NebWebSdk", "navigation failed")
        }

        override fun unsupportedUrl(activity: Activity, uri: Uri) {
          Log.i("NebWebSdk", "URL is unsupported")
        }
      }).getOrThrow()
          .also { this.nowWebService = it }
    }


