# BundleManager

    @objc(LSBundleManager)
    final class BundleManager : BaseManager

    extension BundleManager : CVarArg, CustomDebugStringConvertible, CustomStringConvertible, Equatable, Hashable, NSObjectProtocol

Entry point to the LicenseSpring SDK Class for performing basic requests to LicenseSpring backend and managing license bundles

- `init(configuration:baseStorage:)`

  Initializes the BundleManager with the given configuration

  - Parameter

    - configuration: LicenseSpring configuration object
    - baseStorage: An optional object used for low-level data storage operations such as reading, writing, and deleting raw license data. Accepts either a Swift implementation conforming to `BaseStorage` or an Objective-C object conforming to `LSBaseStorage`. If `nil`, the default internal file-based storage is used. This parameter is primarily intended for advanced customization of how license files are persisted.

  Throws

  `LSError` if the configuration is invalid or the client cannot be initialized.

  Note

  In Objective-C, pass an instance conforming to the `LSBaseStorage` protocol for `baseStorage`. In Swift, pass an instance conforming to `BaseStorage`.

  #### Declaration

  Swift

      @objc
      init(configuration: Configuration, baseStorage: AnyObject? = nil) throws

  #### Parameters

  `configuration` | LicenseSpring configuration object
  `baseStorage` | An optional object used for low-level data storage operations such as reading, writing, and deleting raw license data. Accepts either a Swift implementation conforming to `BaseStorage` or an Objective-C object conforming to `LSBaseStorage`. If `nil`, the default internal file-based storage is used. This parameter is primarily intended for advanced customization of how license files are persisted.

- `cachedLicenses`

  Activated Bundle or empty dictionary if no license is active.

  #### Declaration

  Swift

      @objc
      var cachedLicenses: LicenseBundle

- `baseStorage`

  Base Storage object passed by the user for custom license storage implementation

  #### Declaration

  Swift

      let baseStorage: any BaseStorage

- `activateBundle(licenseKey:)`

  Activate the bundle using license key.

  Throws

  Error if license activation fails. May be of `LSError` type.

  #### Declaration

  Swift

      @objc
      func activateBundle(licenseKey: String) throws -> LicenseBundle

  #### Parameters

  `licenseKey` | License key for the product.

  #### Return Value

  Activated bundle.

- `activateBundle(username:password:)`

  Activate the license bundle using username and password.

  Throws

  Error if license activation fails. May be of `LSError` type. @objc

  #### Declaration

  Swift

      func activateBundle(username: String, password: String) throws -> LicenseBundle

  #### Parameters

  `password` | User’s password.

  #### Return Value

  Activated bundle.

- `activateBundle(username:password:serverId:)`

  Activate the license bundle using username and password.

  Throws

  Error if license activation fails. May be of `LSError` type. @objc

  #### Declaration

  Swift

      @objc
      func activateBundle(username: String, password: String, serverId: Int64) throws -> LicenseBundle

  #### Parameters

  `password` | User’s password.

  #### Return Value

  Activated bundle.

- `activateBundle(idToken:)`

  Activate the bundle using idToken

  Throws

  Error if license activation fails. May be of `LSError` type.

  #### Declaration

  Swift

      @objc
      func activateBundle(idToken: String) throws -> LicenseBundle

  #### Return Value

  Activated bundle.

- `activateBundle(code:)`

  Activate the bundle using code

  Throws

  Error if license activation fails. May be of `LSError` type.

  #### Declaration

  Swift

      @objc
      func activateBundle(code: String) throws -> LicenseBundle

  #### Return Value

  Activated bundle.

- `deactivateBundle(licenseKey:removeLocalData:)`

  Deactivates the license bundle using licenseKey.

  #### Declaration

  Swift

      @objc
      func deactivateBundle(licenseKey: String, removeLocalData: Bool = true) -> Bool

  #### Parameters

  `licenseKey` | License key for the product
  `removeLocalData` | flag to remove local bundle data

  #### Return Value

  True if the deactivation is successfull

- `deactivateBundle(username:password:removeLocalData:)`

  Deactivates the license bundle using username and password.

  #### Declaration

  Swift

      @objc
      func deactivateBundle(username: String, password: String, removeLocalData: Bool = true) -> Bool

  #### Parameters

  `password` | User’s password.
  `removeLocalData` | flag to remove local bundle data

  #### Return Value

  True if the deactivation is successfull

- `deactivateBundle(idToken:customerAccountCode:removeLocalData:)`

  Deactivates the license bundle using idToken and customerAccountCode.

  #### Declaration

  Swift

      @objc
      func deactivateBundle(idToken: String, customerAccountCode: String, removeLocalData: Bool = true) -> Bool

  #### Parameters

  `idToken` |
  `customerAccountCode` | .
  `removeLocalData` | flag to remove local bundle data

  #### Return Value

  True if the deactivation is successfull

- `deactivateBundle(code:customerAccountCode:removeLocalData:)`

  Deactivates the license bundle using code and customerAccountCode.

  #### Declaration

  Swift

      @objc
      func deactivateBundle(code: String, customerAccountCode: String, removeLocalData: Bool = true) -> Bool

  #### Parameters

  `code` |
  `customerAccountCode` | .
  `removeLocalData` | flag to remove local bundle data

  #### Return Value

  True if the deactivation is successfull

- `checkBundle(licenseKey:)`

  Check bundle for validity on the LicenseSpring platform.

  Throws

  Error if remote or local checks fail.

  #### Declaration

  Swift

      @objc
      func checkBundle(licenseKey: String) throws -> LicenseBundle

  #### Parameters

  `licenseKey` | License key for the product.

  #### Return Value

  Current bundle.

- `checkBundle(username:)`

  Check bundle for validity on the LicenseSpring platform.

  Throws

  Error if remote or local checks fail.

  #### Declaration

  Swift

      @objc
      func checkBundle(username: String) throws -> LicenseBundle

  #### Parameters

  `username` | User ID, typically email in lowercase.

  #### Return Value

  Current bundle.

- `requestSSOURL(useAuthCode:redirectURI:)`

  Retrieve URL for Single Sign-On license activation.

  Throws

  Error if request fails. May be of `LSError` type.

  #### Declaration

  Swift

      @objc
      func requestSSOURL(useAuthCode: Bool = true, redirectURI: String = "") throws -> URL

  #### Parameters

  `useAuthCode` | If `true` (default), generates an SSO URL for the Authorization Code flow. If `false`, uses the Implicit flow.
  `redirectURI` | Optional redirect URI to use. Must be one of the allowed redirect URIs for the customer account. If empty or nil, the default (first) redirect URI is used.

  #### Return Value

  URL for Single Sign-On.

- `requestSSOURL(useAuthCode:redirectURI:)`

  Retrieve URL for Single Sign-On license activation.

  Throws

  Error if request fails. May be of `LSError` type.

  #### Declaration

  Swift

      @objc(requestSSOURLDetailedWithUseAuthCode:redirectURI:error:)
      func requestSSOURL(useAuthCode: Bool = true, redirectURI: String = "") throws -> SSOURL

  #### Parameters

  `useAuthCode` | If `true` (default), generates an SSO URL for the Authorization Code flow. If `false`, uses the Implicit flow.
  `redirectURI` | Optional redirect URI to use. Must be one of the allowed redirect URIs for the customer account. If empty or nil, the default (first) redirect URI is used.

  #### Return Value

  SSOURL for Single Sign-On.

- `getAllSSOUrls(useAuthCode:redirectURI:)`

  Retrieve all available SSO URLs. The first element is the main SSO URL, followed by alternate URLs in the order received from the License API.

  Throws

  Error if request fails. May be of `LSError` type.

  #### Declaration

  Swift

      @objc
      func getAllSSOUrls(useAuthCode: Bool = true, redirectURI: String = "") throws -> [URL]

  #### Parameters

  `useAuthCode` | If `true` (default), generates SSO URLs for the Authorization Code flow. If `false`, uses the Implicit flow.
  `redirectURI` | Optional redirect URI to use. Must be one of the allowed redirect URIs for the customer account. If empty or nil, the default (first) redirect URI is used.

  #### Return Value

  Array of SSO URLs with the main URL first.

- `activateBundleOffline(_:)`

  Activate the license using license activation response file.

  Throws

  Error if license activation fails. May be of `LSError` type.

  #### Declaration

  Swift

      @objc
      func activateBundleOffline(_ activationResponseFile: URL) throws -> LicenseBundle

  #### Parameters

  `activationResponseFile` | Activation response file location.

  #### Return Value

  Activated license bundle.

- `createOfflineActivationFile(licenseKey:preferredLocation:)`

  Creates offline activation file request.

  Throws

  Error if create activation file fails. May be of `LSError` type.

  #### Declaration

  Swift

      @objc
      func createOfflineActivationFile(licenseKey: String, preferredLocation: URL? = nil) throws -> URL

  #### Parameters

  `licenseKey` | License key to be activated offline.
  `preferredLocation` | Optional custom activation request file location. ‘~/Desktop/ls_activation.req’ by default.

  #### Return Value

  Location of offline activation file request.

- `createOfflineActivationFile(user:password:preferredLocation:serverID:)`

  Creates offline activation file request.

  Throws

  Error if create activation file fails. May be of `LSError` type.

  #### Declaration

  Swift

      @objc
      func createOfflineActivationFile(user: String, password: String, preferredLocation: URL? = nil, serverID: Int64 = 0) throws -> URL

  #### Parameters

  `user` | User ID, typically email in lowercase.
  `password` | User’s password.
  `preferredLocation` | Optional custom activation request file location. ‘~/Desktop/ls_activation.req’ by default.
  `serverID` | serverID, server-side license identifier, typically 64-bit id.

  #### Return Value

  Location of offline activation file request.

- `deactivateBundleOffline(licenseKey:serverID:preferredLocation:deviceVariables:)`

  Creates the deactivate bundle offline request

  #### Declaration

  Swift

      @objc
      func deactivateBundleOffline(licenseKey: String, serverID: Int64 = 0, preferredLocation: URL? = nil, deviceVariables: [DeviceVariable]? = nil) throws -> URL

  #### Parameters

  `licenseKey` | licenseKey: License key to be activated offline.

- `deactivateBundleOffline(username:serverID:preferredLocation:deviceVariables:)`

  Creates the deactivate bundle offline request

  #### Declaration

  Swift

      @objc
      func deactivateBundleOffline(username: String, serverID: Int64 = 0, preferredLocation: URL? = nil, deviceVariables: [DeviceVariable]? = nil) throws -> URL

  #### Parameters

  `username` | User ID, typically email in lowercase.

- `getCurrentBundle()`

  Returns current bundle of licenses (from memory or disk)

  #### Declaration

  Swift

      func getCurrentBundle() throws -> LicenseBundle

  #### Return Value

  current License Bundle

- `loadLicensesFromStorage()`

  Loads all licenses in a bundle from persistent storage

  #### Declaration

  Swift

      func loadLicensesFromStorage() throws -> LicenseBundle

  #### Return Value

  current License Bundle

- `getCurrentLicense()`

  Undocumented

  #### Declaration

  Swift

      func getCurrentLicense() -> License?

- `reconfigure(appName:appVersion:customerAccountCode:airgapKey:serviceURL:hardwareID:collectHostNameAndLocalIP:networkTimeout:proxyHost:proxyPort:gracePeriod:skipResponseSignatureChecks:client_id:client_secret:CryptoProviderKey:isOauth:extendedOptions:)`

  Undocumented

  #### Declaration

  Swift

      func reconfigure(appName: String? = nil, appVersion: String? = nil, customerAccountCode: String? = nil, airgapKey: String? = nil, serviceURL: URL? = nil, hardwareID: String? = nil, collectHostNameAndLocalIP: Bool? = nil, networkTimeout: TimeInterval? = nil, proxyHost: String? = nil, proxyPort: UInt16? = nil, gracePeriod: TimeInterval? = nil, skipResponseSignatureChecks: Bool? = nil, client_id: String? = nil, client_secret: String? = nil, CryptoProviderKey: String? = nil, isOauth: Bool? = nil, extendedOptions: ExtendedOptions? = nil) throws

© 2026 LicenseSpring. All rights reserved. (Last updated: 2026-05-27)

Generated by jazzy ♪♫ v0.15.3, a Realm project.