Configuration
public class Configuration : Decodable
Represents the configuration to be used for the Cheetah Loyalty Framework
This loads configuration values from the CheetahLoyalty-Info.plist
file from the main bundle.
A missing or incomplete CheetahLoyalty-Info.plist
file will cause a precondition failure.
The list of property keys is defined in Configuration.CodingKeys
.
-
The shared instance of
Configuration
which contains the configuration values from theCheetahLoyalty-Info.plist
file from the main bundle.Note
A missing or incompleteCheetahLoyalty-Info.plist
file will cause a precondition failure.Declaration
Swift
public static let shared: Configuration
-
The user agent name for the app
Declaration
Swift
public let userAgentName: String
-
The API KEY for the Loyalty API
Declaration
Swift
public let clientId: String
-
The API SECRET KEY for the Loyalty API
Declaration
Swift
public let clientSecret: String
-
The URL of the Loyalty API gateway
Declaration
Swift
public let clientUrl: String
-
The API metric
Declaration
Swift
public let metric: String
-
Boolean flag that indicates whether geofencing is enabled
Declaration
Swift
public let isGeofencingEnabled: Bool
-
String indicating the business unit
Declaration
Swift
public let businessUnit: String
-
Boolean flag that indicates whether the access token is from an external source
Declaration
Swift
public let isAccessTokenExternal: Bool
-
Enumeration of configuration properties used for entity mapping.
See moreDeclaration
Swift
public enum CodingKeys : String, CodingKey
-
Keys used for values stored in the standard
UserDefaults
.- sendLocationAnonymously: Key to store a
Bool
indicating if the user should send their location anonymously. - lastActiveTrackingDate: Key to store the
Date
of when the user was last tracked active.
Declaration
Swift
public enum DefaultsKeys : String
- sendLocationAnonymously: Key to store a
-
Gets the value for a
DefaultsKeys
from the standardUserDefaults
.Declaration
Swift
public static func getDefaultsValue(for key: DefaultsKeys) -> Any?
Parameters
key
The key as
DefaultsKeys
.Return Value
The value corresponding to the key as
Any
. -
Sets the value for a
DefaultsKeys
to the standardUserDefaults
.Declaration
Swift
public static func setDefaults(value: Any?, for key: DefaultsKeys)
Parameters
value
The value to be set in the standard
UserDefaults
. If the value is nil, it removes the currently set object for the key from the standardUserDefaults
.key
The key as
DefaultsKeys
.