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.

Stored Properties

  • 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

Initializers

API

  • 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. Use DataSubscription.unsubscribeThroughNotifications() or DataSubscription.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 the DataNode.subscribeThroughWebhook() method.

    This method requires a user to be authenticated.

    Declaration

    Swift

    public func getLongTermSubscriptions() -> [NotificationContext]

    Return Value

    An array of NotificationContext

Equatable Protocol

  • 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 same WebcomConfiguration.identifier.

    Declaration

    Swift

    public static func == (left: WebcomApplication, right: WebcomApplication) -> Bool

Hashable Protocol

  • Declaration

    Swift

    public func hash(into hasher: inout Hasher)

CustomStringConvertible Protocol

  • Declaration

    Swift

    public var description: String { get }

CustomDebugStringConvertible Protocol

  • Declaration

    Swift

    public var debugDescription: String { get }

Helper Extension

  • The Authentication service for this application.

    There is only one instance of AuthenticationService class for each application. Distinct applications do not share AuthenticationService 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 share DataService 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 share DatasyncService 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 }

Combine Module

  • 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:

    import WebcomCombine
    
    See more

    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 }