Debug view: Add offerings section and purchasing capabilities#1186
Conversation
There was a problem hiding this comment.
I could listen to purchase completion/errors in the composable... But felt that it would be better to move that logic to the viewModel. In order to pass the callbacks as parameters to the view model, we need to create a factory like this.
There was a problem hiding this comment.
For the preview, I'm just creating a dummy activity. Shouldn't matter as long as the purchase buttons are not pressed.
There was a problem hiding this comment.
Here I'm assuming there will always be an activity... I guess we could handle this and fail gracefully, but the debug view should always be used within a compose project that has an activity, and this is only for debug, so I thought it was ok. Lmk if you think otherwise.
There was a problem hiding this comment.
I think it's fine. Maybe a more descriptive message could help
There was a problem hiding this comment.
I'm showing the toast as part of the debug view. I think it's ok, but I was wondering whether it would be better to just leave to the developer to handle it as they see fit, since there is a callback. Thoughts?
There was a problem hiding this comment.
Honestly, I'm not sure if this is too many options for a public debug view... But I thought it could be useful to visualize the different subscription options.
Codecov Report
@@ Coverage Diff @@
## main #1186 +/- ##
=======================================
Coverage 85.92% 85.92%
=======================================
Files 181 181
Lines 6216 6216
Branches 899 899
=======================================
Hits 5341 5341
Misses 533 533
Partials 342 342 |
There was a problem hiding this comment.
I think it's fine. Maybe a more descriptive message could help
There was a problem hiding this comment.
Are we concerned these logs won't go through the logHandler if there's one configured? I don't think there's anything we can do anyways
There was a problem hiding this comment.
yeah, that's not ideal... But not sure of a solution... We would need to expose something in the SDK to allow us to hook these logs to the same handler, and not sure it's worth it...
Personally, I think it's fine for now, and we can revisit later if needed, but lmk if you want to chat about it more.
|
This is great!! |
**This is an automatic release.** ### Bugfixes * Fix NoSuchElementException by using poll when accessing serviceRequests (#1190) via Cesar de la Vega (@vegaro) ### Other Changes * Debug view: rename package (#1191) via Toni Rico (@tonidero) * Debugview: Add snapshot tests for debug view using Paparazzi (#1187) via Toni Rico (@tonidero) * Debug view: Add offerings section and purchasing capabilities (#1186) via Toni Rico (@tonidero) * Debug view: Initial UI + Usage in MagicWeatherCompose (#1075) via Toni Rico (@tonidero) * Remove customEntitlementComputation flavor for non-purchases modules (#1180) via Toni Rico (@tonidero) Co-authored-by: revenuecat-ops <ops@revenuecat.com>
Description
This PR adds the offerings section to the debug menu and allows to purchase packages, products and subscription options for those offerings.
Screen_recording_20230801_110036.mp4