Webcom
public enum Webcom
A namespace for global stuff for the SDK.
This enumeration does not contain any case, since it is only used as a namespace.
-
The short name of the SDK.
Declaration
Swift
public static let shortName: String -
The full name of the SDK.
Declaration
Swift
public static let fullName: String -
The version number of the SDK.
Declaration
Swift
public static let version: String -
The home page of the SDK.
Declaration
Swift
public static let home: URL -
The default platform.
This value is used as the default value for the
WebcomConfiguration.platformproperty.Declaration
Swift
public static let defaultPlatform: URL -
The default push notification subscription refresh ratio.
This value is used as the default value for the
WebcomConfiguration.pushNotificationRefreshDurationRatioproperty.Declaration
Swift
public static let defaultPushNotificationRefreshRatio: UInt
-
Configures the SDK.
This method may be called multiple times but it produces effects only the first time. On next calls, it is a no-operation. It is implicitly called with default arguments when initializing the first
WebcomApplicationinstance. So, you should call it before that if you want to use custom arguments.Declaration
Swift
public static func configure(groupName: String? = nil)Parameters
groupNameThe app group, used to share data between the main application and extensions.
-
The user defaults key for the minimum level of logs to emit.
This key is used to initialize the
minimumLogLevelproperty.Declaration
Swift
public static let minimumLogLevelKey: String -
The minimum level of logs to issue.
A log is issued when its level is more important than or equal to the value of this property (see
WebcomLog.Level.>=). When this property isnil, no log is issued.It is initialized using the string value of the
minimumLogLevelKeykey, but applications may modify it.Declaration
Swift
public static var minimumLogLevel: WebcomLog.Level? { get set } -
The customized closure used by the SDK for logging.
The closure takes in parameter a single
WebcomLogvalue.It is only called for logs whose level is more important than or equal to
minimumLogLevel.It is designed to be set by applications. When this property is
nil, theWebcomLog.systemLog()method is used instead.Declaration
Swift
public static var log: ((WebcomLog) -> Void)?
-
Gets a default-configured
URLSessionConfigurationinstance.This method is used to initialize the
defaultSessionproperty.Declaration
Swift
public static func defaultSessionConfiguration() -> URLSessionConfiguration -
The
URLSessioninstance used by default by the SDK.The initial value of this property is a session configured using the
defaultSessionConfigurationmethod.If it is necessary to modify this property, this should be done before it is read for the first time. Also, since the SDK uses it for many operations, it is best to do this early in the application lifetime.
Declaration
Swift
public static var defaultSession: URLSession
-
The
DispatchQueueused by default to dispatch callbacks.The initial value of this property is
.main.Declaration
Swift
public static var defaultCallbackQueue: DispatchQueue
-
The device token for push notifications.
The setter is designed to be called from the
messaging(_:didReceiveRegistrationToken:)method of theMessagingDelegateprotocol from theFirebasemodule.Declaration
Swift
public static var deviceToken: String? { get set }
-
Tries to open an URL with the SDK.
This method is designed to be called from the
application(_:open:options:)method of theUIApplicationDelegate.Declaration
Swift
public static func openURL(_ url: URL) -> BoolParameters
urlThe URL to open.
Return Value
trueif the URL has been processed by the SDK,falseotherwise.
-
A value representing an error when reading configurations.
See moreDeclaration
Swift
public enum ConfigurationError : Swift.Error -
The default application.
It corresponds to the first application configured using the
Webcom.shortNamekey of the information dictionary file (Info.plist) file of the.mainbundle.An iOS application will typically use a single Webcom application. This property is designed to be the instance representing it.
Declaration
Swift
public static let defaultApplication: WebcomApplication -
The default configurations.
The default configurations are specified using the
Webcom.shortNamekey of the information dictionary file (Info.plist) of the.mainbundle.Declaration
Swift
public static let defaultConfigurations: [WebcomConfiguration] -
Gets the configurations from the information dictionary file (
Info.plist) of a bundle.Throws
AConfigurationErrorvalue when the information dictionary file does not contain thekeykey or an unspecified error when the corresponding value could not be decoded as expected.Declaration
Swift
public static func configurations(from bundle: Bundle = .main, withKey key: String = shortName) throws -> [WebcomConfiguration]Parameters
bundleThe bundle whose information dictionary file must be read.
keyThe key of the information dictionary file to read.
Return Value
The newly created configurations.