UnbluWebApiHelper

class UnbluWebApiHelper

Helpers that call the Unblu REST API directly, without initializing the SDK or loading the WebView.

  • Declaration

    Swift

    struct NotificationCountResult
  • Sends a GET request to the Unblu backend to fetch the notification count for the person in the current request context (resolved from the configuration’s cookies / SSO token).

    Can be called before the SDK is initialized, since it relies only on the provided configuration.

    If an access token (visitor JWT) is set, it is first exchanged for session cookies with UnbluAuthHelper.authenticateWithAccessToken(with:success:failure:); if that exchange fails, failure is called.

    Declaration

    Swift

    static func getOwnNotificationCount(with configuration: UnbluClientConfiguration, success: @escaping (UnbluWebApiHelper.NotificationCountResult) -> Void, failure: ((String) -> Void)?)

    Parameters

    success

    Closure called with the decoded NotificationCountResult upon success.

    failure

    Optional closure called with an error message string if the request fails.