fix iOS build blockers and add project scaffold
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import Combine
|
||||
import Foundation
|
||||
|
||||
@MainActor
|
||||
protocol AnalyticsTracking {
|
||||
func track(_ event: String, attributes: [String: String])
|
||||
}
|
||||
|
||||
@@ -10,8 +10,8 @@ final class LocalizationStore: ObservableObject {
|
||||
private static let supportedLocaleCodes = ["en", "sv"]
|
||||
private static let fallbackLocaleCode = "en"
|
||||
|
||||
init(bundle: Bundle = .main, localeCode: String = Locale.preferredLanguages.first.map { String($0.prefix(2)) } ?? "en") {
|
||||
self.bundle = bundle
|
||||
init(bundle: Bundle? = nil, localeCode: String = Locale.preferredLanguages.first.map { String($0.prefix(2)) } ?? "en") {
|
||||
self.bundle = bundle ?? Self.defaultBundle
|
||||
self.localeCode = Self.normalize(localeCode)
|
||||
}
|
||||
|
||||
@@ -64,4 +64,12 @@ final class LocalizationStore: ObservableObject {
|
||||
|
||||
return localeCode
|
||||
}
|
||||
|
||||
private static var defaultBundle: Bundle {
|
||||
#if SWIFT_PACKAGE
|
||||
.module
|
||||
#else
|
||||
.main
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -91,7 +91,8 @@ struct HermesAPIClient {
|
||||
}
|
||||
|
||||
func submitAnalyticsBatch(_ payload: HermesAnalyticsBatchRequest) async throws {
|
||||
try await perform(path: "api/v1/analytics/batch", method: "POST", body: payload)
|
||||
let encodedBody = try encoder.encode(payload)
|
||||
_ = try await perform(path: "api/v1/analytics/batch", method: "POST", body: encodedBody)
|
||||
}
|
||||
|
||||
private func send<Response: Decodable>(path: String, method: String = "GET") async throws -> Response {
|
||||
|
||||
@@ -113,14 +113,6 @@ struct HermesRound: Codable {
|
||||
var settlement: HermesSettlement
|
||||
}
|
||||
|
||||
struct HermesRound: Codable {
|
||||
var event: HermesEvent
|
||||
var media: HermesEventMedia
|
||||
var market: HermesMarket
|
||||
var oddsVersion: HermesOddsVersion
|
||||
var settlement: HermesSettlement
|
||||
}
|
||||
|
||||
struct HermesBetIntentRequest: Codable {
|
||||
var sessionId: UUID
|
||||
var eventId: UUID
|
||||
|
||||
Reference in New Issue
Block a user