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
URLSessioninstance used by this application.When this property is
nil,Webcom.defaultSessionis used instead.Declaration
Swift
public var defaultSession: URLSession? -
The
DispatchQueueused by default to schedule callbacks.When this property is
nil,Webcom.defaultCallbackQueueis used instead.Declaration
Swift
public var defaultCallbackQueue: DispatchQueue? -
The
JSONEncoderinstance used to serialize data for this application.This property is initialized using the
createDefaultJSONEncoder()static function.Declaration
Swift
public var jsonEncoder: JSONEncoder -
The
JSONDecoderinstance 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
configurationThe 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
markerUse the
WebcomMarkers.NoJavaScriptAPI.noJavaScriptAPIvalue to disambiguate with theinit(configuration:)overload.configurationThe configuration to use.
-
Returns a new JSON encoder.
The returned instance is configured with:
iso8601date encoding strategy,base64data encoding strategy.
This function is used to initialize the
jsonEncoderproperty of instances.Declaration
Swift
public static func createDefaultJSONEncoder() -> JSONEncoderReturn Value
A new
JSONEncoderinstance -
Returns a new JSON decoder.
The returned instance is configured with:
iso8601date decoding strategy,base64data decoding strategy.
This function is used to initialize the
jsonDecoderproperty of instances.Declaration
Swift
public static func createDefaultJSONDecoder() -> JSONDecoderReturn Value
A new
JSONDecoderinstance -
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.platformand 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
AuthenticationServiceclass for each application. Distinct applications do not shareAuthenticationServiceinstances. 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
DataServiceclass for each application. Distinct applications do not shareDataServiceinstances. 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
DatasyncServiceclass for each application. Distinct applications do not shareDatasyncServiceinstances. 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
WebcomApplicationin order to enrich it with a Combine-based API.See also the documentation section of
WebcomWrapperfor the corresponding wrapped type.To use this type, import the following dependency in your code:
See moreimport WebcomCombineDeclaration
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 }