Skip to content

Migrate Ditto SDK v4 → v5 (5.0.2) on iOS and Android#89

Draft
Brian Plattenburg (bplattenburg) wants to merge 4 commits into
bp/per-collection-repositoriesfrom
bp/sdk-v5-migration
Draft

Migrate Ditto SDK v4 → v5 (5.0.2) on iOS and Android#89
Brian Plattenburg (bplattenburg) wants to merge 4 commits into
bp/per-collection-repositoriesfrom
bp/sdk-v5-migration

Conversation

@bplattenburg

@bplattenburg Brian Plattenburg (bplattenburg) commented Jun 12, 2026

Copy link
Copy Markdown
Member

Migrates both apps from Ditto SDK v4 to v5 (5.0.2), following the v5 migration guide. Stacked on #88.

SDK / tools versions

SDK Tools
iOS DittoSwiftPackage 5.0.2 DittoSwiftTools 10.0.0-rc.1
Android com.ditto:ditto-kotlin:5.0.2 live.ditto:ditto-tools-android:6.0.1-rc.1

Tools are pre-GA (preview/RC) — that's the only v5-compatible option today, hence draft.

iOS

  • DittoManager: DittoConfig + Ditto.openSync(config:); auth via auth.expirationHandler + login(token:provider:.development).
  • Removed the DittoObjC product (folded into DittoSwift in v5) from all four project.pbxproj sections.
  • Added explicit import Foundation where DittoSwift no longer re-exports it.
  • Repos/observers already used v5-compatible APIs (registerObserver(…handlerWithSignalNext:), store.execute, registerSubscription) — unchanged.

Android

  • Artifact live.ditto:dittocom.ditto:ditto-kotlin; imports live.ditto.*com.ditto.kotlin.* (app package live.ditto.pos.*, wrapper live.ditto.ditto_wrapper, and tools live.ditto.tools.* are unchanged).
  • DittoManager: DittoFactory.create(DittoConfig(...)) + auth expiration handler.
  • Observers now use store.observe(query, args) { … } (cold Flow); the v4 registerObserver signalNext backpressure overload no longer exists in Kotlin.
  • store.execute(...) returns Unit → dropped .use { } on write calls.
  • Removed disableSyncWithV3() and the DQL_STRICT_MODE=false workaround (v5 defaults match).

Config changes (breaking for local setup)

Env/local.properties keys renamed to match the v5 portal:

  • DITTO_APP_IDDITTO_DATABASE_ID
  • DITTO_PLAYGROUND_TOKENDITTO_DEVELOPMENT_TOKEN
  • DITTO_WEBSOCKET_URLDITTO_URL (single portal Connect/Auth URL; the separate wss:// websocket URL is no longer used)

Update your iOS/.env and Android/local.properties accordingly.

cc Aaron LaBeau (@biozal) Walker Erekson (@texasRanger09) @getditto/commercial-solutions

Drop tvOS support

Ditto SDK v5 no longer officially supports tvOS (or visionOS — the app never targeted visionOS). Removed tvOS from the iOS app:

  • SUPPORTED_PLATFORMSiphoneos iphonesimulator; TARGETED_DEVICE_FAMILY 1,2,31,2; dropped TVOS_DEPLOYMENT_TARGET.
  • Collapsed all #if os(tvOS) / #if !os(tvOS) branches to the iOS path (9 files).

iOS:
- DittoConfig + Ditto.openSync; auth expirationHandler + login(.development)
- Remove DittoObjC product (folded into DittoSwift in v5)
- DittoSwiftPackage 5.0.1, DittoSwiftTools 10.0.0-preview.3
- Add explicit Foundation import where DittoSwift no longer re-exports it

Android:
- com.ditto:ditto-kotlin 5.0.1, ditto-tools-android 6.0.1-rc.1
- DittoFactory.create + DittoConfig; com.ditto.kotlin.* imports
- store.observe() Flow for observers; execute() returns Unit
- Drop disableSyncWithV3 / DQL_STRICT_MODE workaround (v5 defaults match)

Config: rename to DITTO_DATABASE_ID, DITTO_DEVELOPMENT_TOKEN, DITTO_URL
(single portal Connect/Auth URL; separate websocket URL removed).
Ditto SDK v5 no longer officially supports tvOS (or visionOS), so remove
tvOS from the iOS app:

- project.pbxproj: SUPPORTED_PLATFORMS now iphoneos/iphonesimulator only;
  TARGETED_DEVICE_FAMILY 1,2,3 → 1,2; remove TVOS_DEPLOYMENT_TARGET.
- Collapse all #if os(tvOS) / #if !os(tvOS) branches to the iOS path across
  MainView, KDSOrderView, KDSOrdersGridView, Utils, POSView, POSGridView,
  POSViewModel, POSOrderView, LocationsView, DittoManager.
@bplattenburg Brian Plattenburg (bplattenburg) changed the title Migrate Ditto SDK v4 → v5 (5.0.1) on iOS and Android Migrate Ditto SDK v4 → v5 (5.0.2) on iOS and Android Jun 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant