Repository navigation
Conversion Tracking - #25
Conversation
Adds a dedicated recordPurchase API on both native SDKs mirroring the /sdk/mobile/v1/purchase backend contract, replacing the untyped track(event: "TrackConversion", ...) example that never actually hit the network. Rejects invalid input (blank orderId, non-positive value, malformed url) client-side without a network call, and documents the new API in the root README. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
There was a problem hiding this comment.
Code Review
This pull request introduces a dedicated recordPurchase API to both the Android and iOS SDKs for tracking completed purchases and conversion attribution, along with corresponding models, validation logic, documentation, and unit tests. The review feedback is highly constructive and suggests strengthening input validation by ensuring the purchase value is finite (isFinite) on both platforms to prevent serialization failures. Additionally, it recommends casting Unix timestamps to Int64 instead of Int in Swift to avoid potential overflow issues on 32-bit architectures.
Addresses Gemini Code Assist review feedback on PR #25: value <= 0 doesn't reject NaN/Infinity (comparisons with NaN are always false, so Kotlin's <= 0 check let NaN through as "valid"), and Int can overflow event_time on 32-bit architectures. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces a new recordPurchase API for both Android and iOS SDKs to support conversion attribution. It includes the necessary data models, network client updates, and comprehensive validation for inputs like orderId, value, and url. The reviewer suggests enhancing the validation logic by filtering the items list to ensure data integrity and improving URL construction robustness by trimming trailing slashes from the base URL.
…id baseURL Addresses second round of Gemini Code Assist feedback on PR #25: a single malformed item (blank id, non-finite value, non-positive quantity) previously aborted the entire purchase since it corrupted JSON serialization of the whole payload, even though the top-level value had already passed validation — now invalid items are dropped with a warning instead. Also trims a trailing slash from Android's baseURL at construction (mirroring iOS) so a misconfigured baseURL can't double up in any endpoint path.
feat: add recordPurchase conversion tracking to iOS and Android SDKs
Adds a dedicated recordPurchase API on both native SDKs mirroring the
/sdk/mobile/v1/purchase backend contract, replacing the untyped
track(event: "TrackConversion", ...) example that never actually hit
the network. Rejects invalid input (blank orderId, non-positive value,
malformed url) client-side without a network call, and documents the
new API in the root README.
Co-Authored-By: Claude Sonnet 5 noreply@anthropic.com