DiscoveryServiceConfigurationProvider

open class DiscoveryServiceConfigurationProvider : ConfigurationProviding

Built-in configuration provider that obtains data from the SAP Discovery Service. See Enabling Applications to Discover Configurations and Using the Configuration Discovery Service.

  • Default class initializer.

    Declaration

    Swift

    public convenience init()
  • Overloaded class initializer. Creates a DiscoveryServiceConfigurationProvider object with the specified app identifier.

    Declaration

    Swift

    public init(applicationID: String? = nil)

    Parameters

    applicationID

    App identifier to use for web requests to the Discovery Service. If no value is supplied, the calling app’s CFBundleIdentifier value will be obtained at runtime. This parameter allows for obtaining configuration data for a different app than the caller.

  • A read-only property. The value for this class is com.sap.configuration.provider.discoveryservice.

    Declaration

    Swift

    public var providerIdentifier: String { get }
  • Reports what input(s) are required for operation. The value for this class is a Dictionary containing the key ConfigurationProviderInputKeys.emailAddress and a value for the key. For example, a Dictionary structured as so:

     var example: [String: Any] = [ConfigurationProviderInputKeys.emailAddress.rawValue : "example@sap.com"]
    

    Declaration

    Swift

    public var expectedInput: [String : Any] { get }
  • Attempts to obtain data if required input has been supplied.

    Declaration

    Swift

    public func provideConfiguration(input: [String: Any] = [:]) -> (providerSuccess: Bool, configuration: NSDictionary, returnError: Error?)

    Parameters

    input

    Data supplied by app in response to expectedInput dictionary.

    Return Value

    A tuple consisting of providerSuccess (success/fail result), configuration if available, and returnError if applicable.