RevenueCat / purchases-ios

In-app purchases and subscriptions made easy. Support for iOS, watchOS, tvOS, macOS, and visionOS.
https://www.revenuecat.com/
MIT License
2.32k stars 315 forks source link

[Customer Center] Create `CustomerCenterView` #3919

Closed vegaro closed 3 months ago

vegaro commented 4 months ago

Base branch is integration/customer_support_workflow so we don't merge into main yet

Borrows a lot from #3865

Creates a new CustomerCenterView that can be used as a customer support workflow starting point.

All details can be found in https://linear.app/revenuecat/project/sdk-support-workflow-cf7f6a1d5340/overview

vegaro commented 4 months ago

I've only run the views via previews - is there a better way?

I've been doing that as well, since making a purchase with PaywallsTester has been complicated. I was planning on looking into that today, so I can test deserialization, etc

To get it to compile I had to change LocalizedString from let enUS: String to let en_US: String (I think the linter made this change, but we should ignore its rule in this case), and CustomerCenterData.FeedbackSurvey.Option to CustomerCenterData.FeedbackSurveyOption.

Oops yes, that's on me. I fixed the linting issues and broke the compilation. Sorry about that

cc @jamesrb1

vegaro commented 4 months ago

It looks like I still have to fix some availability checks, but this is good for another pass I think :)

vegaro commented 3 months ago

I ended up removing LocalizedString because localization will most likely be handled in a different way and this was making the response more complex c0a38a1 (#3919)

vegaro commented 3 months ago

[!WARNING] This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite. Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @vegaro and the rest of your teammates on Graphite Graphite

vegaro commented 3 months ago

Thank you @tonidero! Most of the hardcoded strings will go away since we are going to try to localize everything in the backend. So that's for future PRs.

vegaro commented 3 months ago

Going to merge it since the PRs are accumulating. @jamesrb1 feel free to make more comments that I can address in another PR if needed