RewardsAPI
Ce contenu n’est pas encore disponible dans votre langue.
struct RewardsAPICampaigns and reward selection. Obtained from FrakClient.rewards.
Conforms to Swift.Sendable
Defined in: Sources/FrakSDK/RewardsAPI.swift:4
Methods
Section titled “Methods”best(_:forceRefresh:)
Section titled “best(_:forceRefresh:)”func best( _ request: RewardRequest = RewardRequest(), forceRefresh: Bool = false) async throws -> BestReward?The best reward worth advertising for request, formatted server-side. One call answers
for the whole set it describes and cannot say which item earned it, so a listing screen
calls this once for every visible product rather than once per row.
- Parameters:
- request: what to look the reward up for;
productsis advisory ranking context. - forceRefresh: skips the cache and the backoff.
- request: what to look the reward up for;
- Returns: nil when nothing matches.
- Throws:
FrakErrorwhen the lookup itself fails.
campaigns(forceRefresh:)
Section titled “campaigns(forceRefresh:)”func campaigns(forceRefresh: Bool = false) async throws -> [Campaign]Active campaigns for this merchant, highest priority first.