NowSDK framework - iOS

  • Release version: Australia
  • Updated March 12, 2026
  • 1 minute to read
  • The NowSDK framework contains methods that enable the instantiation of various feature services.

    NowSDK - configure(with configuration: NowSDKConfiguration) throws

    Configures NowSDK for use. You must call this function before calling any of the feature services within the Mobile SDK.

    Note:
    If the configuration that you pass is invalid, a NowSDKError is thrown.
    Table 1. Parameters
    Name Type Description
    with configuration NowSDKConfiguration NowSDKConfiguration that contains the information necessary to initialize the service.
    Table 2. Returns
    Type Description
    None, NowSDKError NowSDKError is thrown if the configuration that you pass is invalid.

    The following code example shows how to call this function.

    guard 
      let jwtUrl = URL(string: "http://13.57.38.237:8080"),
      let instanceUrl = URL(string: "https://mobilecoresdk.service-now.com") else {
        return
      }
    
    // AuthorizationProvider – struct conforming to NowSDKAuthorizationProviding protocol
    let authorizationProvider = AuthorizationProvider(userEmail: "sdk@servicenow.com", jwtProviderUrl: jwtUrl, clientId: "deb8756b452d201039231ca568f26511")
            
    // PermissionProvider – class conforming to DevicePermissionDelegate protocol
    let permissionProvider = PermissionProvider()
    let config = NowSDKConfiguration(authorizationProvider: authorizationProvider, permissionDelegate: permissionProvider, logLevel: .debug)
    
    do {
      try NowSDK.configure(with: config)
                …
    } catch {
       print(“error is \(error.localizedDescription)”)
    }

    NowSDK - core()

    Returns a reference to the SDK core service.

    Note:
    Host applications don't need to call this function.
    Table 3. Parameters
    Name Type Description
    None
    Table 4. Returns
    Type Description
    Object Object conforming to the NowCoreServiceProviding protocol is returned if the SDK has been initialized by calling the NowSDK - configure(with configuration: NowSDKConfiguration) throws method; otherwise nil.

    The following code example shows how to call this function.

    guard let coreService = NowSDK.core() else {
      // Error with NowServiceError.sdkNotConfigured
      return
    }

    NowSDK - makeServiceConfiguration(for instanceUrl: URL)

    Convenience function that feature services can use to construct n NowServiceConfiguration object.

    Table 5. Parameters
    Name Type Description
    instanceUrl URL URL of the ServiceNow instance that the service will access.
    Table 6. Returns
    Type Description
    NowServiceConfiguration If the specified URL passes basic validity checks, and the service configuration can be properly constructed, returns the NowServiceConfiguration object; otherwise nil.

    The following code example shows how to call this function.

    guard 
      let instanceUrl = URL(string: "https://mobilecoresdk.service-now.com"),
      let serviceConfig = NowSDK.makeServiceConfiguration(for: instanceUrl) else {
        logger.error(message: "Could not create service - service configuration invalid")
        return 
      }