ditto = Ditto(
identity: DittoIdentity.onlinePlayground(
appID: "REPLACE_ME_WITH_YOUR_APP_ID",
token: "REPLACE_ME_WITH_YOUR_PLAYGROUND_TOKEN",
enableDittoCloudSync: false, // This is required to be set to false to use the correct URLs
customAuthURL: URL(string: "REPLACE_ME_WITH_YOUR_AUTH_URL")
)
)
ditto.updateTransportConfig { transportConfig in
// Set the Ditto Websocket URL
transportConfig.connect.webSocketURLs.insert("wss://REPLACE_ME_WITH_YOUR_WEBSOCKET_URL")
}
// Disable DQL strict mode so that collection definitions are not required in DQL queries
try await ditto.store.execute("ALTER SYSTEM SET DQL_STRICT_MODE = false")
do {
try ditto.startSync()
} catch {
print(error.localizedDescription)
}