Integrating the Customer Center
Overviewβ
Customer Center is a self-service UI that can be added to your app to help your customers manage their subscriptions on their own. With it, you can prevent churn with pre-emptive promotional offers, capture actionable customer data with exit feedback prompts, and lower support volumes for common inquiries β all without any help from your support team.
There are only two steps to integrate the Customer Center in your app:
- Implementing the Customer Center view in your app
- Setting up promotional offers
Implementationβ
You can use the CustomerCenterView
view directly:
- SwiftUI
import RevenueCatUI
...
var body: some View {
Group {
NavigationStack {
HomeView()
.navigationTitle("Home")
.navigationBarTitleDisplayMode(.inline)
.toolbar {
ToolbarItem(placement: .topBarLeading) {
Button {
} label: {
Image(systemName: "line.3.horizontal")
}
}
ToolbarItem(placement: .topBarTrailing) {
Button {
self.isCustomerCenterPresented = true
} label: {
Image(systemName: "person.crop.circle")
}
}
}
}
}
.foregroundColor(.white)
.sheet(isPresented: $isCustomerCenterPresented) {
CustomerCenterView()
}
}
Or via a modifier:
- SwiftUI
import RevenueCatUI
...
VStack {
Button {
self.presentingCustomerCenter = true
} label: {
TemplateLabel(name: "Customer Center", icon: "person.fill")
}
}
.presentCustomerCenter(isPresented: self.$presentingCustomerCenter) {
self.presentingCustomerCenter = false
}
Listening to eventsβ
We've added a way to listen to events that occur within the CustomerCenterView
. For now, we are not posting any event to our backend (like feedback survey selections). We are going to be adding way more events in the future, but these are what are available for now:
- Swift
CustomerCenterView { customerCenterAction in
switch customerCenterAction {
case .restoreStarted:
case .restoreFailed(_):
case .restoreCompleted(_):
case .showingManageSubscriptions:
case .refundRequestStarted(_):
case .refundRequestCompleted(_):
}
}
If using the modifier:
- Swift
.presentCustomerCenter(
isPresented: self.$presentingCustomerCenter,
customerCenterActionHandler: { action in
switch action {
case .restoreCompleted(let customerInfo):
case .restoreStarted:
case .restoreFailed(let error):
case .showingManageSubscriptions:
case .refundRequestStarted(let productId):
case .refundRequestCompleted(let status):
case .feedbackSurveyCompleted(let surveyOptionID):
}
}
) {
self.presentingCustomerCenter = false
}
Setting up promotional offersβ
Promotional offers on the App Store allow you to provide a custom price or trial for a product to existing or previosuly subscribed customers. These offers are used in the Customer Center to incentivize customers to stay subscribed who otherwise intend to cancel their subscription or request a refund.
Unique promotional offers can be assigned to different paths and survey responses in the Customer Center, but first they must be setup in App Store Connect.
Learn how to setup promotional offers in App Store Connect here.
Required promotional offersβ
You need to add the App Store promotional offer ids you want to use for each of your products in the Offers tab of the Customer Center settings. Otherwise, the promotional offer will not be shown to customers.
The Customer Center will automatically show promotional offers based on specific user actions. By default we have defined it for refunds and cancellations but it can be modified to any of the defined paths. Hereβs how it works:
Cancellation Retention Discount: By default, for responses in the cancellation survey, RevenueCat will use a promotional offer that you can customize in the Offers tab of the Customer Center settings.
Refund Retention Discount: By default, when a user requests a refund, RevenueCat will use a promotional offer that you can customize in the Offers tab of the Customer Center settings.
This setup enables RevenueCat to automatically match the right offer based on a userβs actions, providing a seamless experience for both cancellation and refund requests.
If the SDK cannot locate a matching promotional offer id, it will bypass the survey and proceed with the userβs requested actionβeither canceling or refunding the subscription.
These promotional offers must be created in App Store Connect in order to be shown to customers. After creating a promotional offer for a product in App Store Connect, you have to assign it to a particular offer in the Offers tab of the Customer Center settings.
For example, if you want to assign an offer with id "monthly_subscription_refund_offer" that you just created for your monthly subscription product, you would go to the Offers tab of the Customer Center settings and edit the "Refund Retention Discount" offer, and assign the promotional offer id to that monthly subscription product.
You may also customize your configuration to provide other offers, or provide them at other points. Learn more about configuring the Customer Center.