brave-plastic-57094
04/09/2025, 3:24 PMstrong-mouse-55694
04/10/2025, 4:16 PMbrave-plastic-57094
04/10/2025, 5:22 PMfreezing-postman-69602
04/21/2025, 6:36 PMbackgroundSync
to false
. You could then create a custom SSE connection manager with a sync schedule you like.
// Step 1: Initialize GrowthBook with backgroundSync: false
var gb = GrowthBookBuilder(
apiHost: "<https://cdn.growthbook.io>",
clientKey: "sdk-abc123",
attributes: [:],
trackingCallback: { experiment, result in
// Track experiments
},
backgroundSync: false // Important: disable default background sync
).initializer()
// Step 2: Create a custom SSE manager (implementation details in GitHub example)
let sseUrl = "\(apiHost)/sub/\(clientKey)"
let sseManager = CustomSSEManager(growthBookSDK: gb, sseUrl: sseUrl)
// Step 3: Start background sync with custom refresh schedule (every 5 minutes)
sseManager.startBackgroundSync(syncIntervalSeconds: 300)
I understand this is not in-built feature our SDK offers at this time but this is one possible way of achieving it.brave-plastic-57094
04/21/2025, 8:21 PM