Migrate Ditto SDK v4 → v5 (5.0.2) on iOS and Android#89
Draft
Brian Plattenburg (bplattenburg) wants to merge 4 commits into
Draft
Migrate Ditto SDK v4 → v5 (5.0.2) on iOS and Android#89Brian Plattenburg (bplattenburg) wants to merge 4 commits into
Brian Plattenburg (bplattenburg) wants to merge 4 commits into
Conversation
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.
7e2f54c to
8688a7d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Migrates both apps from Ditto SDK v4 to v5 (
5.0.2), following the v5 migration guide. Stacked on #88.SDK / tools versions
5.0.210.0.0-rc.1com.ditto:ditto-kotlin:5.0.2live.ditto:ditto-tools-android:6.0.1-rc.1Tools are pre-GA (preview/RC) — that's the only v5-compatible option today, hence draft.
iOS
DittoManager:DittoConfig+Ditto.openSync(config:); auth viaauth.expirationHandler+login(token:provider:.development).DittoObjCproduct (folded intoDittoSwiftin v5) from all fourproject.pbxprojsections.import FoundationwhereDittoSwiftno longer re-exports it.registerObserver(…handlerWithSignalNext:),store.execute,registerSubscription) — unchanged.Android
live.ditto:ditto→com.ditto:ditto-kotlin; importslive.ditto.*→com.ditto.kotlin.*(app packagelive.ditto.pos.*, wrapperlive.ditto.ditto_wrapper, and toolslive.ditto.tools.*are unchanged).DittoManager:DittoFactory.create(DittoConfig(...))+ auth expiration handler.store.observe(query, args) { … }(coldFlow); the v4registerObserversignalNextbackpressure overload no longer exists in Kotlin.store.execute(...)returnsUnit→ dropped.use { }on write calls.disableSyncWithV3()and theDQL_STRICT_MODE=falseworkaround (v5 defaults match).Config changes (breaking for local setup)
Env/
local.propertieskeys renamed to match the v5 portal:DITTO_APP_ID→DITTO_DATABASE_IDDITTO_PLAYGROUND_TOKEN→DITTO_DEVELOPMENT_TOKENDITTO_WEBSOCKET_URL→DITTO_URL(single portal Connect/Auth URL; the separatewss://websocket URL is no longer used)Update your
iOS/.envandAndroid/local.propertiesaccordingly.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_PLATFORMS→iphoneos iphonesimulator;TARGETED_DEVICE_FAMILY1,2,3→1,2; droppedTVOS_DEPLOYMENT_TARGET.#if os(tvOS)/#if !os(tvOS)branches to the iOS path (9 files).