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
DiscoveryServiceConfigurationProviderobject with the specified app identifier.Declaration
Swift
public init(applicationID: String? = nil, discoveryServiceHost: String? = nil)Parameters
applicationIDApp 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.
discoveryServiceHostDiscovery Service Host parameter used for storing custom discoveryServiceHost url. This url is used to obtain data from SAP Discovery Service. If no value is supplied, default Discovery Service Host is obtained from function discoveryServiceHostnameFor(_:).
-
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
Dictionarycontaining the keyConfigurationProviderInputKeys.emailAddressand a value for the key. For example, aDictionarystructured 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
inputData supplied by app in response to
expectedInputdictionary.Return Value
A tuple consisting of
providerSuccess(success/fail result),configurationif available, andreturnErrorif applicable.