RemoteSettingsService
open class RemoteSettingsService : RemoteSettingsServiceProtocol, @unchecked Sendable
Application-level Remote Settings manager.
This handles application-level operations, like syncing all the collections, and acts as a factory for creating clients.
-
Declaration
Swift
required public init(unsafeFromRawPointer pointer: UnsafeMutableRawPointer)
-
Construct a [RemoteSettingsService]
This is typically done early in the application-startup process.
This method performs no IO or network requests and is safe to run in a main thread that can’t be blocked.
storage_dir
is a directory to store SQLite files in – one per collection. If the directory does not exist, it will be created when the storage is first used. Only the directory and the SQLite files will be created, any parent directories must already exist.Declaration
Swift
public convenience init(storageDir: String, config: RemoteSettingsConfig2)
-
Create a new Remote Settings client
This method performs no IO or network requests and is safe to run in a main thread that can’t be blocked.
Declaration
Swift
open func makeClient(collectionName: String) -> RemoteSettingsClient
-
Sync collections for all active clients
Declaration
Swift
open func sync() throws -> [String]
-
Update the remote settings config
This will cause all current and future clients to use new config and will delete any stored records causing the clients to return new results from the new config.
Only intended for QA/debugging. Swapping the remote settings server in the middle of execution can cause weird effects.
Declaration
Swift
open func updateConfig(config: RemoteSettingsConfig2) throws