Add DeferredPurchasesListener via EventChannel bridge#436
Open
Add DeferredPurchasesListener via EventChannel bridge#436
Conversation
Add deferredPurchaseStream to Qonversion API, exposing deferred purchase completions as a Stream<QDeferredTransaction>. - Create QDeferredTransaction Dart model with fromJson factory - Add qonversion_flutter_deferred_purchase EventChannel - iOS/macOS: forward qonversionDidCompleteDeferredPurchase to EventChannel - Android: forward onDeferredPurchaseCompleted to EventChannel Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
NickSxti
commented
Mar 18, 2026
Author
NickSxti
left a comment
There was a problem hiding this comment.
Self-review notes:
Follows existing EventChannel pattern exactly - the implementation mirrors updatedEntitlementsStream at every layer:
- Dart: new
EventChannel('qonversion_flutter_deferred_purchase')with.receiveBroadcastStream().cast<String>().map()toQDeferredTransaction.fromJson() - iOS:
FlutterListenerWrapperregistered with postfix"deferred_purchase", event forwarded viaeventSinkon main thread - macOS: same as iOS
- Android:
BaseListenerWrapperwithEVENT_CHANNEL_DEFERRED_PURCHASE, Gson serialization to eventSink
QDeferredTransaction model - uses fromJson factory with safe null-coalescing (as String? ?? ''), handles num to double conversion for value field. Keys match the Sandwich SDK mapper output (productId, transactionId, originalTransactionId, type, value, currency).
Cleanup - Android tearDown() properly nullifies deferredPurchaseStreamHandler.
Not verified locally - Flutter/Dart not installed. Code follows established patterns 1:1.
Depends on: Sandwich SDK PR qonversion/sandwich-sdk#302
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.
Summary
deferredPurchaseStreamto public Qonversion API asStream<QDeferredTransaction>QDeferredTransactionDart model withfromJsonfactoryqonversionDidCompleteDeferredPurchase/onDeferredPurchaseCompletedevents throughqonversion_flutter_deferred_purchaseEventChannelDependencies
Test plan
Fixes DEV-674
Generated with Claude Code