NowSDK architecture
-
- UpdatedFeb 1, 2024
- 3 minutes to read
- Washington DC
- Developer guides
The NowSDK is the top-level entity of the Mobile SDK class framework.
It contains numerous classes, interfaces, and functions that enable you to leverage the significant capabilities provided by the Mobile SDK and your ServiceNow instance. This document focuses on describing the primary feature services exposed in the Mobile SDK that enable you to interact with your ServiceNow instance.
In order to use any of the feature services provided by the Mobile SDK, you need to integrate the NowSDK library into your code. You must call the core library to configure and initialize the SDK before using any SDK functionality.
NowSDK provides the following capabilities:
- SDK initialization and settings retrieval and configuration.
- Seamless authorization and user session handling.
- Logging interface. The NowSDK provides logging services to all feature services. By default, log messages are written to system logs using platform-specific functionality. You can control the logging threshold through a
parameter that is part of the call to configure the SDK. There is also an option to suppress all log messages generated by the SDK and its feature services (
log level = none
). If you already have your own logging solution in place, the Mobile SDK allows you to use it. - Build and release infrastructure.
- NowDataSDK
Enables third party applications to access the public REST APIs exposed by your ServiceNow instance. Development is streamlined because the NowDataSDK utilizes the authentication and session handling features provided by the NowSDK.
- Primary APIs:
- NowAPIService: This API provides functionality that enables you to interact with the publicly exposed REST APIs on your ServiceNow instance.
- NowAttachmentService: This API provides functionality to upload and query file attachments on your ServiceNow instance within your Android application.
- NowGraphQLService: This API provides functionality that enables you to use GraphQL queries to obtain data from tables within your ServiceNow instance using the ServiceNow REST GraphQL API.
- NowTableService: This API provides functionality that enables you to perform create, read, update, and delete (CRUD) operations on existing tables in your ServiceNow instance that get serviced through the ServiceNow REST Table API.
- Primary APIs:
- NowAnalytics
Enables you to gather and track usage analytics within your mobile applications.
- Primary APIs:
- NowAnalytics: This API provides functionality to gather user analytics data and store it within the ServiceNow platform for later analysis and tracking.
- Primary APIs:
- NowChat
Enables you to embed a native Virtual Agent chat window in your applications. This service includes UI/UX features.
- Primary APIs:
- NowChatService: This API provides Virtual Agent and Live Agent chat capabilities to your Android applications. Leverage the full service chat capabilities provided by the ServiceNow platform by simply implementing NowChatService within your application.
- Primary APIs:
- NowPush
Enables you to send unsolicited messages to your applications that leverage the NowChat/Virtual Agent functionality.
- Primary APIs:
- NowPushSDK: This API provides the function necessary to create a
NowPushService
that enables the sending of unsolicited (push) notifications to Android devices. - NowPushService: This API provides functions that enable interaction with the Push Service.
- NowPushSDK: This API provides the function necessary to create a
- Primary APIs:
- NowWeb
Enables you to load web pages hosted on your ServiceNow instance in a native web view or Cabrillo. It automatically handles user authentication and session management instead of forcing users to log into the instance via a login web page.
When the webview is requested to load a web page hosted on a ServiceNow instance, it creates an HTTP request with the appropriate bearer header containing the OAuth access token provided by the NowSDK. When the instance receives this request, it starts a new user session and returns cookies related to that session. As the user interacts with the web pages in the webview, the instance uses the cookies to validate that the session is still valid. At this point, the bearer header is no longer relevant, only the cookies are used for session validation. The web session expires if the user stops interacting with the website for longer than the timeout period. After the session expires, if the user tries to interact with the web page, they are automatically redirected to the login page. The NowWebViewController detects the redirection and attempts to start a new web session by requesting a refreshed access token from the NowSDK and using the token to create a HTTP request (with bearer header) for the last known loaded page.
- Primary APIs:
NowWebSDK: This API provides functionality to create a NowWeb service object that enables web pages from your ServiceNow instance to be displayed in your Android application.
- Primary APIs: