NotificationService

public final actor NotificationService

This service provides an AsyncStream callback mechanism for processing notifications.

Public

  • Undocumented

    Declaration

    Swift

    public init()
  • Processes the received push message.

    Throws:

    Declaration

    Swift

    public func processNotification(forUserInfo userInfo: [AnyHashable : Any]) async throws
  • retry(userInfo:) Asynchronous

    A mechanism to send the server request again in the event of an error such as a timeout, with no or weak network coverage.

    Throws:

    Declaration

    Swift

    public func retry(userInfo: [AnyHashable : Any]) async throws
  • updatePushToken(_:) Asynchronous

    Request to update the push notification token. This function is called whenever the application receives a new push token. The SDK is able to recognize when the same push token is provided. The SDK will return success without making a network call.

    Throws:

    Declaration

    Swift

    public func updatePushToken(_ token: String) async throws
  • Notification Service Errors

    See more

    Declaration

    Swift

    public enum Error : Sendable
    extension NotificationService.Error: Error
  • These are the known message types when a notification is processed.

    See more

    Declaration

    Swift

    public enum KnownMessage : String
  • Different types of push messages.

    See more

    Declaration

    Swift

    public enum MessageSeverity : Sendable
  • It contains the data received from server

    See more

    Declaration

    Swift

    public struct ServerMessage : Sendable
  • State for Notification Service with processNotification(forUserInfo:) and retry(userInfo:).

    See more

    Declaration

    Swift

    public enum State : @unchecked Sendable