Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose Customer Center to UIKit #4560

Merged
merged 6 commits into from
Dec 9, 2024
Merged

Expose Customer Center to UIKit #4560

merged 6 commits into from
Dec 9, 2024

Conversation

fire-at-will
Copy link
Contributor

@fire-at-will fire-at-will commented Dec 6, 2024

Description

This PR:

  • Exposes the Customer Center to UIKit through a new public CustomerCenterViewController class
  • Adds a way to test the CustomerCenterViewController in the PaywallTester app
  • Adds CustomerCenterViewController API tests to the RevenueCatUISwiftAPITester app

Testing

  • Manually tested displaying the new CustomerCenterViewController in the PaywallTester app

@fire-at-will
Copy link
Contributor Author

@RCGitBot please test

@fire-at-will fire-at-will marked this pull request as ready for review December 6, 2024 16:33
@fire-at-will fire-at-will requested review from vegaro and a team December 6, 2024 16:33
Copy link
Member

@aboedo aboedo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! Left a few small comments.

There's a decent amount of extra layout stuff we ended up doing for Paywalls View Controller for proper layout in hybrids, that I imagine we'll likely want to apply for Customer Center too sooner or later.

But we can think about extracting out the logic into a subclass and then using it for both later, I don't believe it'd lead to breaking changes

@@ -39,6 +39,7 @@ public struct CustomerCenterView: View {
/// - Parameters:
/// - customerCenterActionHandler: An optional `CustomerCenterActionHandler` to handle actions
/// from the customer center.
/// - mode: The presentation mode for the customer center. Defaults to `.default`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️


#if canImport(UIKit) && os(iOS)

/// Warning: This is currently in beta and subject to change.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤔 let's not even have this. We really shouldn't be changing the UI, and we're going GA very soon in any case.


/// Warning: This is currently in beta and subject to change.
///
/// A SwiftUI view for displaying a customer support common tasks
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// A SwiftUI view for displaying a customer support common tasks
/// A UIKit ViewController for displaying a customer support common tasks

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also that docstring's copy could generally be improved, "displaying a customer support common tasks" sounds broken.

I realize that this is likely copy-pasted from SwiftUI, maybe we do a follow-up PR improving both sides

/// Create a view controller to handle common customer support tasks
/// - Parameters:
/// - customerCenterActionHandler: An optional `CustomerCenterActionHandler` to handle actions
/// from the customer center.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feels like we should brand this and go always Customer Center rather than customer center

Copy link
Contributor

@tonidero tonidero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a decent amount of extra layout stuff we ended up doing for Paywalls View Controller for proper layout in hybrids, that I imagine we'll likely want to apply for Customer Center too sooner or later.

Most of that was to support footer paywalls so hopefully it should be much simpler in this case. We should also decide whether we want to support both a "presentCustomerCenter" style API and a declarative "CustomerCenterView" in the hybrids or only one of them... Mostly this has to do with the "dismissal" mechanism. But for now, this PR looks ok to me!

@fire-at-will
Copy link
Contributor Author

@RCGitBot please test

@fire-at-will fire-at-will merged commit 451b8cf into main Dec 9, 2024
10 checks passed
@fire-at-will fire-at-will deleted the customercenter-uikit branch December 9, 2024 19:02
This was referenced Dec 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants