Aller au contenu

FrakConfig

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

struct FrakConfig

Everything the SDK needs to start, supplied once to Frak.initialize(_:).

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

Defined in: Sources/FrakSDK/Core/FrakConfig.swift:62

init(merchantId:bundleId:metadata:env:deepLink:trackingEnabled:logLevel:logSink:)

Section titled “init(merchantId:bundleId:metadata:env:deepLink:trackingEnabled:logLevel:logSink:)”
init(
merchantId: String? = nil,
bundleId: String? = nil,
metadata: FrakMetadata = FrakMetadata(),
env: FrakEnvironment = .production,
deepLink: DeepLinkHandling = .manual,
trackingEnabled: Bool = true,
logLevel: FrakLogLevel = .none,
logSink: (any FrakLogSink)? = nil
)
let bundleId: String?
let deepLink: DeepLinkHandling
let env: FrakEnvironment
let logLevel: FrakLogLevel
let logSink: (any FrakLogSink)?
let merchantId: String?
let metadata: FrakMetadata
let trackingEnabled: Bool

Whether tracking may run. false means no anonymous id is ever minted and no tracking request is issued; it is a hard floor that FrakClient.setTrackingEnabled(_:) cannot lift at runtime.

Not a whole-SDK off switch: merchant config and reward resolution still run, since they carry no identifier for the user. Sharing does stop, since a share link is the anonymous id.

Leave it true and drive consent through FrakClient.setTrackingEnabled(_:) instead unless you want a build that can never track.

func hash(into hasher: inout Hasher)

Hashes the essential components of this value by feeding them into the given hasher.

Implement this method to conform to the Hashable protocol. The components used for hashing must be the same as the components compared in your type’s == operator implementation. Call hasher.combine(_:) with each of these components.

  • Important: In your implementation of hash(into:), don’t call finalize() on the hasher instance provided, or replace it with a different instance. Doing so may become a compile-time error in the future.

  • Parameter hasher: The hasher to use when combining the components of this instance.

!=(::)

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.
static func == (lhs: FrakConfig, rhs: FrakConfig) -> Bool

Returns a Boolean value indicating whether two values are equal.

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

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