QPSettings
public class QPSettings : NSObject, Codable
Class representing the SDK settings. It extends Glossy to support (de)serialisation from and to JSON.
-
Undocumented
Declaration
Swift
static let userDefaultsKey: String -
Undocumented
Declaration
Swift
public var buildNumber: Int -
Controls if vsign messages are read by the TTS service
Declaration
Swift
public var enableTextToSpeech: Bool -
API key
Declaration
Swift
public var apiKey: String? -
Mobile Base API url
Declaration
Swift
public var mobileApiBaseUrl: String -
Categories API url
Declaration
Swift
public var categoriesApiUrl: String -
Base API URL for metrics service. Default is equal to ‘apiBaseUrl’.
Declaration
Swift
public var metricsApiBaseUrl: String -
Base API URL for services.
Declaration
Swift
public var mobileApiBaseUrl2: String -
Base API URL for FCD services.
Declaration
Swift
public var fcdApiBaseUrl: String -
Terminals Base API url
Declaration
Swift
public var terminalsApiBaseUrl: String -
Presence period defined in hours
Declaration
Swift
internal var presencePeriod: Int -
Default API domain
Declaration
Swift
public var apiDomain: QPApiDomain -
Controls how often (in seconds) we poll the API for new vSigns
Declaration
Swift
public var apiPollInterval: Int -
Value (in meters) passed to the API as the vsign coverage radius. A value of
1000would ask the API to give us all vsigns in the given radius.Declaration
Swift
public var apiCoverageRadius: Int -
Value in degrees controlling the tolerance for the angle used to detect the entering direction for a vsign
Declaration
Swift
public var bearingToleranceDegrees: Int -
Controls if the entering angle should be used when detecting if a visgin is being entered
Declaration
Swift
public var enableBearingChecks: Bool -
GPS updates older than this value (in seconds) will be discarded as outdated. Useful to discard out of date locations when the GPS doesn’t work properly.
Declaration
Swift
public var gpsLocationMaxAgeSeconds: Int -
GPS updates that fall outside of this accurancy range (in meters) will be discarded as too inaccurate to be used.
Declaration
Swift
public var gpsLocationMinHorizontalAccuracy: Int -
Notified vSigns will be re-notified again once re-entered if the previous notification is older than this value (in seconds)
Declaration
Swift
public var notifiedTimeoutSeconds: Int -
Notified vSigns will be re-notified again once re-entered if the user has reached this min distance (in meters) from the vsign area.
Declaration
Swift
public var notifiedMinDistanceInMeters: Double -
Volume for the TTS messages
Declaration
Swift
public var ttsVolume: Float -
Number of TTS messages will be repeated. If not defined or zero messages wont be repeated. Default is 0.
Declaration
Swift
public var ttsIterations: Int -
Value (in seconds) to determine the delay between TTS messages iterations. Default is 2.
Declaration
Swift
public var ttsIterationDelay: Double -
Determines whether or not play a Jingle before a tts message. Default is false.
Declaration
Swift
public var playJingleBeforeTTS: Bool -
Value (in seconds) to determine the delay between Jingle and TTS message. Default is 2.
Declaration
Swift
public var timeIntervalBetweenJingleAndTts: Double -
The remote URL from where download the file.
Declaration
Swift
private(set) public var jingleURL: URL? { get } -
List of available jingles.
Declaration
Swift
public var jingles: [QPJingle]? -
Determines whether or not cache the jingle file after first download. Default is false.
Declaration
Swift
private(set) public var cacheJingle: Bool { get } -
The host app bundle identifier
Declaration
Swift
private(set) public var hostAppBundleId: String? { get } -
Language used to display and read vsign messages
Declaration
Swift
public var language: QPLangCode? -
Frequency (in seconds) at which the SDK detects changes in the user activity
Declaration
Swift
public var activityDetectionUpdateInterval: Double -
List of UserActivityDetectedMessage, containing the text that will be read by the Text-to-speech service when the configured activity type transitions are detected (default: empty list, no TTS messages)
Declaration
Swift
public var activityTransitionMessages: [UserActivityDetectedMessage] -
Language code to be selected from the API vsign messages when there is no key matching the currently selected language
Declaration
Swift
public var ttsActionFallbackLanguage: QPLangCode -
Automatically enable/disable vsign detection and main SDK functionality based on the detected user activity (default: true)
Declaration
Swift
public var enableUpdatesOnActivityDetection: Bool -
Controls how often buffered metrics are sent to the API
Declaration
Swift
public var syncMetricsInterval: Int { get set } -
Accuracy mode for GPS updates
Declaration
Swift
public var gpsDefaultAccuracy: CLLocationAccuracy { get set } -
Accuracy mode for GPS updates when the SDK is short-term suspended. Normally this value should be set lower than gpsDefaultAccuracy , as doing so saves battery while the SDK is suspended but location updates are still performed to make sure the SDK can detect user activity changes even when suspended.
Declaration
Swift
public var suspendedGpsDefaultAccuracy: CLLocationAccuracy -
Accuracy mode for GPS updates when the SDK is long-term suspended. Similar to suspendedGpsDefaultAccuracy, this controls the GPS accurancy used when the SDK transitions in the “long-term” suspended mode, to further optimise battery usage.
Declaration
Swift
public var suspendedLongTermGpsDefaultAccuracy: CLLocationAccuracy -
Automatically pauses GPS updates if the system determines updates are not strictly requires (e.g. the user hasn’t been moving for a while) to save battery.
Declaration
Swift
public var gpsPausesLocationUpdatesAutomatically: Bool { get set } -
Controls how often GPS updates are required, based on the user movements. For example, setting this to
5meters will make the system sends GPS update events only if the user moves outside of a 5 meter radius from their last position.Declaration
Swift
public var gpsDistanceFilter: Int { get set } -
Number of seconds after which the SDK goes into “long term” suspension mode. The SDK first transitions into a “short term” suspended mode, where GPS accuracy is slightly decreased. After the configured number of seconds from the first transition, the SDK further reduces GPS updates frequency and accuracy to save battery.
Declaration
Swift
public var suspendLongTermAfterSeconds: Int -
Similar to gpsDistanceFilter, it controls how often GPS updates are required when the SDK becomes suspended. Location updates triggered by the system are still used to perform activity detection checks even when the app is suspended. Normally this value should be set lower than gpsDistanceFilter , as doing so saves battery while the SDK is suspended.
Declaration
Swift
public var suspendedGpsDistanceFilter: Int -
Similar to suspendedGpsDistanceFilter, it controls how often GPS updates are required when the SDK transitions in the “long term” suspended mode, to further optimise battery usage when the user has been away from a vehicle in a long time (controlled by the suspendLongTermAfterSeconds param)
Declaration
Swift
public var suspendedLongTermGpsDistanceFilter: Int -
Text to be read by the Text-To-Speech service when the SDK gets automatically activated based on the currently detected user activity
Declaration
Swift
public var activationNotificationText: String -
Text to be read by the Text-To-Speech service when the SDK gets automatically de-activated based on the currently detected user activity
Declaration
Swift
public var deactivationNotificationText: String -
List of UserActivityTypes that will enable the SDK main functionality when detected on enter
Declaration
Swift
public var enableOnActivities: [QPUserActivityType] -
List of the categories to be excluded. Signals with this categories will be ignored.
Declaration
Swift
public var excludedCategories: [QPCategory] -
Determines whether or not send FCD to the cloud. Default is false.
Declaration
Swift
var floatingCarDataEnabled: Bool -
Determines the type of FCD to send the cloud. Default is short.
Declaration
Swift
var floatingCarDataEnabledType: QPFCDType -
If enabled, the FCD functionality will activate when user activity is detected. Default is true.
Declaration
Swift
public var floatingCarDataEnabledOnActivity: Bool -
If enabled, the FCD functionality will activate when a specific AVS’s action is detected. Default is false.
Declaration
Swift
public var floatingCarDataEnabledWithAVS: Bool -
Defines how often (in seconds) SDK send floating car data to the cloud.
Declaration
Swift
public var floatingCarDataServiceInterval: Int -
Defines how much FCD valid objects SDK will send to the cloud for each cycle of requests. Default is 3.
Declaration
Swift
public var floatingCarDataRequestBatchSize: Int -
Defines a map of private keys used to decrypt encoded AVS.
Declaration
Swift
public var psk: [QPPsk] -
Undocumented
Declaration
Swift
var ttsLanguage: QPLangCode { get } -
Undocumented
See moreDeclaration
Swift
enum CodingKeys : String, CodingKey -
Declaration
Swift
required public init(from decoder: Decoder) throws -
Declaration
Swift
public func encode(to encoder: Encoder) throws -
Undocumented
Declaration
Swift
public var engine: QPEngine? -
Initialise QPSettings object with default values
Declaration
Swift
public override init() -
Initialise QPSettings specifying an API base url
Declaration
Swift
public init(apiBaseUrl: String? = nil, apiKey: String? = nil) -
Stores current settings to System User Defaults
Declaration
Swift
public func saveToUserDefaults() -
Restore saved settings from System User Defaults.
Declaration
Swift
public static func restoreFromUserDefaults() -> QPSettingsReturn Value
The current saved settings.
-
Set the URL from where retrieve the jingle file.
Declaration
Swift
public func setJingle(url: URL, bundleIdentifier: String? = nil, cacheFile: Bool = false)Parameters
urlThe URL (remote or local) of file.
bundleIdentifierThe app’s bundle identifier. Default is nil.
cacheFileIf true the file will be cached locally and will be re-downloaded only if remote Url changes. Default is false.
-
Clear cached Jingle
Declaration
Swift
public func clearCachedJingle()
QPSettings Class Reference