Aller au contenu

BestReward

Ce contenu n’est pas encore disponible dans votre langue.

struct BestReward

The single reward worth advertising, selected and formatted by the server, so every surface shows an identical number.

formatted contains a non-breaking space (U+00A0) before the currency symbol — render it as-is, never compare it against an ordinary-space string.

Conforms to Swift.Equatable, Swift.Hashable, Swift.Sendable

Defined in: Sources/FrakSDK/Rewards/Rewards.swift:98

let formatted: String
let isProductScoped: Bool

Whether the selected campaign is gated to a productScope. The gate, not the reward’s basis — a product-gated campaign can still pay a percentage of the whole basket. Defaults to false so a backend that predates this field still decodes.

let lockupDurationDays: Double?
let matchedProducts: [ProductDetails]?

The subset of the products this call supplied that matched the winning campaign’s scope. nil for an unscoped winner, or when no products were supplied.

let minPurchaseAmount: String?
let minPurchaseValue: Double?
let payoutType: String

Which shape formatted describes: fixed, percentage or tiered. A plain String so a payout type newer than this binary still decodes.

!=(::)

static func != (lhs: Self, rhs: Self) -> Bool

Returns a Boolean value indicating whether two values are not equal.

Inequality is the inverse of equality. For any values a and b, a != b implies that a == b is false.

This is the default implementation of the not-equal-to operator (!=) for any type that conforms to Equatable.

  • Parameters:
    • lhs: A value to compare.
    • rhs: Another value to compare.