NotificationContext

public struct NotificationContext : Codable
extension NotificationContext: WebcomCombinable

A value representing a push notification of webhook context

  • The user ID. We keep this value in case the user’s authentication expires, and another user logs in, to be able to differentiate notification contexts

    Declaration

    Swift

    public let userId: String
  • The application identifier.

    Declaration

    Swift

    public let applicationIdentifier: String
  • The subscription descriptor.

    Declaration

    Swift

    public var descriptor: DataSubscriptionDescriptor

API

  • Cancels the subscription to the related notification.

    Declaration

    Swift

    public func cancel(application: WebcomApplication, session: URLSession? = nil, queue: DispatchQueue? = nil, then completionCallback: WebcomResult<Void>.Callback? = nil)

    Parameters

    application

    The current application.

    session

    The session used to send the request to the back-end. When nil, the default session of the application of this instance is used.

    queue

    The queue to which the provided callback dispatches. When nil, the default callback queue of the application of this instance is used.

    completionCallback

    The closure to call upon completion. In case of success, it is called with a void value. In case of failure, it is called with a WebcomError value indicating the reason of the failure.

  • Updates the subscription to the related notification.

    Declaration

    Swift

    public func update(application: WebcomApplication, descriptor: DataSubscriptionDescriptor, file: StaticString = #fileID, line: UInt = #line, session: URLSession? = nil, queue: DispatchQueue? = nil, then completionCallback: WebcomResult<DataSubscription>.Callback? = nil)

    Parameters

    application

    The current application.

    descriptor

    The descriptor for the subscription.

    file

    The file from which the method is called. This is used for debugging purposes.

    line

    The line from which the method is called. This is used for debugging purposes.

    session

    The session used to send the request to the back-end. When nil, the default session of the application of this instance is used.

    queue

    The queue to which the provided callback dispatches. When nil, the default callback queue of the application of this instance is used.

    completionCallback

    The closure to call upon completion. In case of success, it is called with a value representing the subscription. In case of failure, it is called with a WebcomError value indicating the reason of the failure.

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
  • The wrapping instance, which has a Combine-based API.

    Declaration

    Swift

    public var forCombine: CombineWrapper { get }