Skip to content

Update example app to use deferredPurchaseStream#443

Closed
NickSxti wants to merge 1 commit into
developfrom
nch/sample-deferred-purchases-listener
Closed

Update example app to use deferredPurchaseStream#443
NickSxti wants to merge 1 commit into
developfrom
nch/sample-deferred-purchases-listener

Conversation

@NickSxti

@NickSxti NickSxti commented Apr 7, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Subscribe the example app to Qonversion.deferredPurchaseStream during SDK initialization, mirroring the existing No-Codes stream subscription pattern in main.dart.
  • On a successful deferred purchase, refresh entitlements in AppState so other screens reflect the new state.
  • Track each deferred purchase event in AppState (with a clearable history) so future screens can display them if needed.

Notes

  • The example app previously had no setEntitlementsUpdateListener usage to migrate from. This PR just adds the new API hookup.
  • The stream emits QPurchaseResult (not QDeferredTransaction) - matching lib/src/qonversion.dart and lib/src/dto/purchase_result.dart.

Test plan

  • Build and run the example app on iOS / Android
  • Trigger a deferred purchase (e.g. Ask to Buy / SCA in sandbox)
  • Confirm the debug log prints Deferred purchase ... and entitlements update on success

Subscribe the sample app to the new Qonversion.deferredPurchaseStream
so deferred purchases (e.g. SCA, Ask to Buy) emit a QPurchaseResult that
the app can log and use to refresh entitlements.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@NickSxti

NickSxti commented Apr 7, 2026

Copy link
Copy Markdown
Contributor Author

Closing - no existing entitlements update listener usage in the example app to migrate from. The change would have added a new feature demo rather than performing a migration, which is out of scope of the original request.

@NickSxti NickSxti closed this Apr 7, 2026
@NickSxti NickSxti deleted the nch/sample-deferred-purchases-listener branch April 7, 2026 15:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant