Add DeferredPurchasesListener bridge (iOS + Android)#302
Add DeferredPurchasesListener bridge (iOS + Android)#302
Conversation
Bridge the new DeferredPurchasesListener from native SDKs through the Sandwich layer for cross-platform SDK consumption. iOS: implement Qonversion.DeferredPurchasesListener, add toMap() mapper for DeferredTransaction, register listener in config and async events. Android: add setDeferredPurchasesListener() builder extension, add QDeferredTransaction.toMap() mapper, wire through QonversionEventsListener. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
NickSxti
left a comment
There was a problem hiding this comment.
Self-review notes:
Podspec/Podfile changes - The QonversionSandwich.podspec was changed from "6.6.1" to "~> 6.6" and ios/Podfile was updated to point to the iOS SDK feature branch. These are development-only changes and should be reverted before merge - the podspec version should point to the new iOS SDK release version once DEV-664 is merged and released.
Code changes look correct - both iOS and Android follow the exact same pattern as the existing EntitlementsUpdateListener bridge:
- iOS:
QonversionSandwichconforms toQonversion.DeferredPurchasesListener, serializesDeferredTransactionvia.toMap().clearEmptyValues(), and forwards toqonversionEventListener - Android: private
QonversionConfig.Builder.setDeferredPurchasesListener()extension creates anonymousQDeferredPurchasesListener, serializes via.toMap(), and forwards toqonversionEventsListener - Mapper keys (
productId,transactionId,originalTransactionId,type,value,currency) are consistent across iOS and Android
iOS build verified locally (xcodebuild succeeded). Android build not verifiable locally (Java 8, needs 11+).
pod lib lint can't resolve unpublished Qonversion types (DeferredTransaction, DeferredPurchasesListener) since they only exist in the iOS SDK development branch. Use workspace build with the Podfile that points to the dev branch instead. TODO: revert to `pod lib lint --allow-warnings` after Qonversion 6.7.0 is published to CocoaPods. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…er review Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…redTransaction iOS SDK PR #648 removed QONDeferredTransaction and changed DeferredPurchasesListener to receive QONPurchaseResult instead. This updates the Sandwich iOS bridge to match: - Remove DeferredTransaction and DeferredTransactionType mappers (the types no longer exist in the iOS SDK) - Update deferredPurchaseCompleted to receive PurchaseResult and use its existing toMap(), matching Android Sandwich behavior Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
iOS bridge updated to match iOS SDK changesiOS SDK PR qonversion/qonversion-ios-sdk#648 removed Changes (a7914d1):
This aligns iOS with Android, which already sends Note for Flutter/RN PRsBoth Flutter (#436) and React Native (#423) currently define a |
…ency Keep ~> 6.6 constraint since this branch depends on iOS SDK changes from the deferred-purchase-listener branch (not yet released). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The lockfile was pinned to 647989e which still had the deleted QONDeferredTransaction type. Update to 371a5a8 which has the PurchaseResult-based DeferredPurchasesListener protocol. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Manually editing the lockfile commit hash broke pod install because SPEC CHECKSUMS didn't match. Regenerated via pod install to get correct checksums. Build verified locally. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Resolve version conflict in QonversionSandwich.podspec - keep 6.9.0 from main. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…tibility The CI uses the iOS SDK dev branch (feature/deferred-purchase-listener) which doesn't match the exact 6.9.0 version. Use ~> 6.6 to allow the dev branch. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
.github/workflows/checks.yml
Outdated
| # TODO: revert to `pod lib lint --allow-warnings` after Qonversion 6.7.0 is published to CocoaPods | ||
| # Pre-release: pod lib lint can't resolve unpublished Qonversion types (DeferredTransaction etc.) | ||
| # Using workspace build instead - the Podfile points to the iOS SDK development branch | ||
| cd ios && pod install && cd .. | ||
| xcodebuild build -workspace ios/QonversionSandwich.xcworkspace -scheme Pods-Sample -destination 'platform=iOS Simulator,name=iPhone 16,OS=latest' -quiet |
ios/Podfile
Outdated
|
|
||
| target 'Sample' do | ||
| pod 'QonversionSandwich', :path => '../' | ||
| pod 'Qonversion', :git => 'https://github.com/qonversion/qonversion-ios-sdk.git', :branch => 'feature/deferred-purchase-listener' |
QonversionSandwich.podspec
Outdated
| } | ||
| s.source_files = 'ios/sandwich/**/*.{h,m,swift}' | ||
| s.dependency "Qonversion", "6.9.0" | ||
| s.dependency "Qonversion", "~> 6.6" |
There was a problem hiding this comment.
Why not the latest version?
There was a problem hiding this comment.
Tightened to ~> 6.8. Can't pin to exactly 6.9.0 because the iOS SDK feature branch (feature/deferred-purchase-listener) reports as version 6.8.0 in its podspec - pod install would fail on the version constraint. Will pin to the exact release version once the iOS SDK publishes the DeferredPurchasesListener.
Can't pin to exactly 6.9.0 because the iOS SDK feature branch (feature/deferred-purchase-listener) reports as 6.8.0, which would cause pod install to fail. Tightened from ~> 6.6 to ~> 6.8. Will be pinned to the exact release version once the iOS SDK publishes the DeferredPurchasesListener feature. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Reverted CI workflow back to pod lib lint and removed the Qonversion git branch override from Podfile. Regenerated Podfile.lock with Qonversion 6.9.0 from CocoaPods. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
@SpertsyanKM CI fails after reverting checks.yml - |
DeferredPurchasesListener requires 6.9.0 (no 6.8.x releases exist). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
SpertsyanKM
left a comment
There was a problem hiding this comment.
Yes, we should wait. We can't merge to dev the code that expects unreleased native SDK version. After it's released, just restart checks and then merge.
Summary
DeferredPurchasesListenerfrom native SDKs (iOS #648, Android #785) through the Sandwich SDK layerQonversion.DeferredPurchasesListeneronQonversionSandwich, addtoMap()mapper forDeferredTransaction, register listener during init and async eventssetDeferredPurchasesListener()builder extension, addQDeferredTransaction.toMap()mapper, wire throughQonversionEventsListenerTest plan
Fixes DEV-672
Generated with Claude Code