NowSDKConfiguration class - iOS

  • Rversion finale: Australia
  • Mis à jour 12 mars 2026
  • 1 minute de lecture
  • The NowSDKConfiguration class contains configuration information needed to initialize the NowSDK.

    Tableau 1. Properties
    Name Type Description
    authorizationProvider NowSDKAuthorizationProviding Delegate object that is responsible for providing authorization tokens to the NowSDK upon request.
    logLevel NowLogLevel Level of log messages for the associated logger to store.
    Valid values:
    • debug
    • error
    • fatal
    • info
    • none
    permisionDelegate DevicePermissionDelegate Delegate object called by the NowSDK to request permission from the host application to show system dialog requesting the indicated device permission.

    NowSDKConfiguration - init(authorizationProvider: NowSDKAuthorizationProviding, permissionDelegate: DevicePermissionDelegate, logLevel: NowLogLevel)

    Creates a NowSDKConfiguration object.

    Tableau 2. Parameters
    Name Type Description
    authorizationProvider NowSDKAuthorizationProviding Delegate object that is responsible for providing authorization tokens to the NowSDK on request.
    permissionDelegate DevicePermissionDelegate Delegate object called by the NowSDK to request permission from the host application to show the system dialog for requesting the indicated device permission. For example:
    class PermissionProvider:
    DevicePermissionDelegate {
      func canRequestPermission(_ permission: DevicePermission) → Bool {
        return true
      }
    }
    logLevel NowLogLevel Level of log messages for the associated logger to store.

    This sets the logging level for the core services logger. You can also use the NowLoggingService API to set service log levels.

    Valid values:
    • debug
    • error
    • fatal
    • info
    • none
    Tableau 3. Returns
    Type Description
    None

    The following code example shows how to call this function.

    guard 
      let instanceUrl = URL(string: "https://sn-instance.service-now.com") else {
      return
    }
    
    NowServiceConfiguration(instanceUrl: instanceUrl, appBundleId: "com.servicenow.appBundle")