Files
purchases-ios/Sources/Networking/RemoteConfigFetchContext.swift
Antonio PallaresandCursor 6b64ca4cac feat(remote-config): send fetch_context on config endpoint requests (#7214)
* feat(remote-config): send fetch_context on config endpoint requests

Co-authored-by: Cursor <cursoragent@cursor.com>

* other(remote-config): register RemoteConfigFetchContext.swift in Xcode project

Co-authored-by: Cursor <cursoragent@cursor.com>

* other(remote-config): fix SwiftLint line-length in BackendGetRemoteConfigTests

Co-authored-by: Cursor <cursoragent@cursor.com>

* other(remote-config): clarify RemoteConfigFetchContext doc comment

Co-authored-by: Cursor <cursoragent@cursor.com>

* other(remote-config): pass fetchContext into updateAllCachesIfNeeded

Co-authored-by: Cursor <cursoragent@cursor.com>

* other(remote-config): include fetch_context in config request cache key

Prevents a fresh-wanting fetch (e.g. app_start) from coalescing onto an
in-flight read request and receiving a backend-cached response.

Co-authored-by: Cursor <cursoragent@cursor.com>

* other(remote-config): add fetchContext to BackendRemoteConfigLaneTests

Fixes test compilation after fetchContext became a required parameter
of RemoteConfigRequest.

Co-authored-by: Cursor <cursoragent@cursor.com>

* other(remote-config): add fetchContext to ProductionRemoteConfigIntegrationTests

Fixes BackendIntegrationTests compilation after fetchContext became a
required parameter on RemoteConfigRequest.

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-15 11:14:22 +02:00

21 lines
599 B
Swift

//
// RemoteConfigFetchContext.swift
// RevenueCat
//
// Created by Antonio Pallares.
// Copyright © 2026 RevenueCat, Inc. All rights reserved.
//
import Foundation
/// Describes why the SDK is requesting remote config.
///
/// Each case maps to the SDK situation that triggered the config fetch. The raw `String` value is sent in the
/// remote config request body as the `fetch_context` field.
enum RemoteConfigFetchContext: String, Codable, Equatable {
case appStart = "app_start"
case foreground = "foreground"
case identityChange = "identity_change"
case read = "read"
}