WebcomApplication
public final class WebcomApplication : Hashable, CustomStringConvertible, CustomDebugStringConvertible
extension WebcomApplication: WebcomCombinable
An object representing an application on the back-end.
An iOS application will typically use the Webcom.defaultApplication
instance.
-
The configuration corresponding to this application.
Declaration
Swift
public let configuration: WebcomConfiguration
-
The
URLSession
instance used by this application.When this property is
nil
,Webcom.defaultSession
is used instead.Declaration
Swift
public var defaultSession: URLSession?
-
The
DispatchQueue
used by default to schedule callbacks.When this property is
nil
,Webcom.defaultCallbackQueue
is used instead.Declaration
Swift
public var defaultCallbackQueue: DispatchQueue?
-
The
JSONEncoder
instance used to serialize data for this application.This property is initialized using the
createDefaultJSONEncoder()
static function.Declaration
Swift
public var jsonEncoder: JSONEncoder
-
The
JSONDecoder
instance used to deserialize data for this application.This property is initialized using the
createDefaultJSONDecoder()
static function.Declaration
Swift
public var jsonDecoder: JSONDecoder
-
Creates an instance for which all services available, whether they require the JavaScript API or not.
Declaration
Swift
public convenience init?(configuration: WebcomConfiguration)
Parameters
configuration
The configuration to use.
-
Creates an instance for which only services not requiring the JavaScript API are available.
Declaration
Swift
public convenience init(_ marker: WebcomMarkers.NoJavaScriptAPI, configuration: WebcomConfiguration)
Parameters
marker
Use the
WebcomMarkers.NoJavaScriptAPI.noJavaScriptAPI
value to disambiguate with theinit(configuration:)
overload.configuration
The configuration to use.
-
Returns a new JSON encoder.
The returned instance is configured with:
iso8601
date encoding strategy,base64
data encoding strategy.
This function is used to initialize the
jsonEncoder
property of instances.Declaration
Swift
public static func createDefaultJSONEncoder() -> JSONEncoder
Return Value
A new
JSONEncoder
instance -
Returns a new JSON decoder.
The returned instance is configured with:
iso8601
date decoding strategy,base64
data decoding strategy.
This function is used to initialize the
jsonDecoder
property of instances.Declaration
Swift
public static func createDefaultJSONDecoder() -> JSONDecoder
Return Value
A new
JSONDecoder
instance -
The identifier of this application on the back-end.
Declaration
Swift
public var identifier: String { get }
-
Clears all the ongoing long term subscriptions from the client local storage.
This method requires a user to be authenticated.
WARNING: this method doesn’t cancel the subscriptions! It only removes them from the local storage, so that the
getLongTermSubscriptions()
method can no longer retrieve them. UseDataSubscription.unsubscribeThroughNotifications()
orDataSubscription.unsubscribeThroughWebhook()
to actually cancel them (otherwise they may still persist in the Webcom back end).Declaration
Swift
public func cleanLongTermSubscriptionContexts()
-
Retrieves the list of the ongoing long term subscriptions from the local storage.
Such subscriptions are stored when invoking the
DataNode.subscribeThroughNotifications()
or theDataNode.subscribeThroughWebhook()
method.This method requires a user to be authenticated.
Declaration
Swift
public func getLongTermSubscriptions() -> [NotificationContext]
Return Value
An array of
NotificationContext
-
Indicates whether two applications are equal.
Two applications are equal when they represent the same application on the back-end, i.e. when they have the same
WebcomConfiguration.platform
and the sameWebcomConfiguration.identifier
.Declaration
Swift
public static func == (left: WebcomApplication, right: WebcomApplication) -> Bool
-
Declaration
Swift
public func hash(into hasher: inout Hasher)
-
Declaration
Swift
public var description: String { get }
-
Declaration
Swift
public var debugDescription: String { get }
-
The Authentication service for this application.
There is only one instance of
AuthenticationService
class for each application. Distinct applications do not shareAuthenticationService
instances. Calling this property multiple times always returns the same instance. The first time this property is called for a given application, the instance is initialized and it is stored in the application. On subsequent calls to this property, the stored instance is returned.Declaration
Swift
public var authenticationService: AuthenticationService { get }
-
The Data service for this application.
There is only one instance of
DataService
class for each application. Distinct applications do not shareDataService
instances. Calling this property multiple times always returns the same instance. The first time this property is called for a given application, the instance is initialized and it is stored in the application. On subsequent calls to this property, the stored instance is returned.Declaration
Swift
public var dataService: DataService { get }
-
The Datasync service for this application.
There is only one instance of
DatasyncService
class for each application. Distinct applications do not shareDatasyncService
instances. Calling this property multiple times always returns the same instance. The first time this property is called for a given application, the instance is initialized and it is stored in the application. On subsequent calls to this property, the stored instance is returned.Declaration
Swift
public var datasyncService: DatasyncService { get }
-
The type that wraps
WebcomApplication
in order to enrich it with a Combine-based API.See also the documentation section of
WebcomWrapper
for the corresponding wrapped type.To use this type, import the following dependency in your code:
See moreimport WebcomCombine
Declaration
Swift
public final class CombineWrapper : WebcomWrapper, Hashable, CustomStringConvertible, CustomDebugStringConvertible
-
The wrapping instance, which has a Combine-based API.
Declaration
Swift
public var forCombine: CombineWrapper { get }