Repository navigation
feat(tracking): standard events namespace - #16
Merged
Merged
Conversation
The tracking namespace lands in the native SDKs first and is not released yet, so while it is being bridged the plugin resolves both natives from the sibling checkouts: - Android via mavenLocal, published from android-sdk with `./gradlew :personalization-sdk:publishRees46ReleaseLibraryPublicationToMavenLocal` as `com.personalization:personalization-sdk:2.36.0`; - iOS via a `:path` pod pointing at the ios-sdk checkout. Both are marked LOCAL WIRING in place and revert to the JitPack coordinate and the podspec dependency once the native release ships.
Flutter had no standard tracking events at all — only a custom event and a purchase. They arrive now as `sdk.tracking.*`, the same namespace and the same method names the native SDKs expose: product and category view, search, cart and favorites (single and full sync), story view and click, purchase, custom event and attribution. Typed models rather than maps: `TrackingItem`, `TrackingSource` and `TrackingSourceType`, whose `dynamicBlock` carries the wire value `dynamic`, which cannot name a Dart enum member. Arguments are validated in Dart, before the channel call. Each method has its own Pigeon method and both bridges hand straight to the native `tracking` namespace, so an event fired from Dart is the request the native SDKs send — no JSON assembled in the plugin. `PersonalizationSdk.trackEvent` and `trackPurchase` are deprecated in favour of `tracking.custom` and `tracking.purchase` and keep working. One divergence to settle before release: the iOS `RecommendedByCase` has no `stories` case, so a story-attributed source is dropped by the iOS bridge.
`tracking_namespace_test` asserts that every method reaches its own Pigeon channel with the arguments native expects, that models and the source wire values survive the crossing, that the shop id is threaded through, and that arguments are validated before the call. The demo gets a button per standard event, all calling `sdk.tracking.*`, each writing its outcome into a result line, and its two existing tracking buttons move onto the namespace. `tracking_events_test` taps those buttons and reads the line, so the run exercises every method against the real API.
…e set The iOS namespace renamed its argument labels to match Android and Dart (itemId / categoryId / itemIds), so the Swift bridge follows. A story source no longer has to be dropped on the way to iOS: TrackingSource there now takes TrackingSourceType, which carries `stories`. Dart gains webPushDigest, so all three enums hold the same set.
The natives shipped: Android 2.37.0 (JitPack) and iOS 3.31.0 (CocoaPods). The DEV-4409 local wiring — mavenLocal in three places and a :path pod pointing at a sibling checkout — is gone, and the plugin podspec asks for REES46 3.31.0. Both example apps build against the published artifacts.
Everything Dart sends arrives as a pigeon struct and has to become a native
type. That conversion had no tests, and it is exactly where the bridge can drop
a value silently — a story source used to be dropped there.
Seven tests over TrackingItemWire.native and TrackingSourceWire.native: field
mapping, the Int64 -> Int narrowing on quantity, every wire value Dart can send
resolving to a native case, an unknown type being dropped rather than guessed,
and the native enum holding nothing Dart cannot produce. The last two are the
regression guard for the three TrackingSourceType enums drifting apart.
Added a RunnerTests scheme: the Runner scheme also carries the patrol UI-test
target, which only compiles under `patrol test` and so breaks a plain
`xcodebuild test`. Run with:
flutter pub get && cd ios && xcodebuild -workspace Runner.xcworkspace \
-scheme RunnerTests -sdk iphonesimulator -destination '...' test
`dart format --set-exit-if-changed` is part of PR checks and these four files were never run through it.
Xyzcancer
force-pushed
the
DEV-4409-standart-tracking-metod-unification
branch
from
September 2, 2026 18:49
5215002 to
27e9e20
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.
Стандартные события трекинга как
sdk.tracking.*— тот же неймспейс и те же имена методов, что на нативах. Плагин переведён на опубликованные SDK: Android 2.37.0, iOS 3.31.0.