Skip to content

Commit faf3054

Browse files
authored
Add custom actions section to customer center (#1047)
1 parent 5d984c8 commit faf3054

File tree

4 files changed

+61
-0
lines changed

4 files changed

+61
-0
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// Create a listener to handle custom actions
2+
val customerCenterListener = object : CustomerCenterListener {
3+
override fun onCustomActionSelected(actionIdentifier: String, purchaseIdentifier: String?) {
4+
when (actionIdentifier) {
5+
"contact_support" -> openSupportChat(purchaseIdentifier)
6+
"delete_account" -> showAccountDeletionDialog()
7+
"rate_app" -> openAppStoreRating()
8+
}
9+
}
10+
}
11+
12+
// Display Customer Center with custom action handling
13+
CustomerCenter(
14+
modifier = Modifier.fillMaxSize(),
15+
options = CustomerCenterOptions.Builder()
16+
.setListener(customerCenterListener)
17+
.build(),
18+
) {
19+
// Handle dismissal
20+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
CustomerCenterView()
2+
.onCustomerCenterCustomActionSelected { actionIdentifier, purchaseIdentifier in
3+
// Handle your custom action
4+
// Execute your custom logic here
5+
}

docs/tools/customer-center/customer-center-integration-android.mdx

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ slug: customer-center-integration-android
55
hidden: false
66
---
77
import { sdkVersions } from '@site/src/components/CustomerCenter/CustomerCenterSDKTable';
8+
import customActionsAndroid from '@site/code_blocks/tools/customer-center-custom-actions-android.kt?raw';
89

910
## Installation
1011

@@ -98,6 +99,23 @@ The following events are available:
9899
- `onShowingManageSubscriptions`: Called when the manage subscriptions screen is shown
99100
- `onFeedbackSurveyCompleted`: Called when a user completes a feedback survey
100101

102+
### Custom Actions
103+
104+
:::info Custom Actions support
105+
The minimum supported version is Android SDK version 9.2.0.
106+
:::
107+
108+
Custom Actions allow you to add your own custom management options to the Customer Center. When a customer taps on a custom action, your app receives a callback with the custom action identifier, allowing you to execute your own code.
109+
110+
To handle custom actions, create a CustomerCenterListener with the `onCustomActionSelected` callback:
111+
112+
<RCCodeBlock tabs={[{ type: "kotlin", content: customActionsAndroid, name: "Kotlin" }]} />
113+
114+
Custom actions are configured in the RevenueCat dashboard under Customer Center settings, where you can:
115+
- Set a custom identifier for the action
116+
- Configure the display text and localization
117+
- Position the action within the management options
118+
101119
## Setup promotional offers
102120

103121
Promotional Offers allow developers to apply custom pricing and trials to new customers and to existing and lapsed subscriptions. Unique promotional offers can be assigned to different paths and survey responses in the Customer Center, but first they must be setup in Google Play Console.

docs/tools/customer-center/customer-center-integration-ios.mdx

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ hidden: false
66
---
77

88
import { sdkVersions } from '@site/src/components/CustomerCenter/CustomerCenterSDKTable';
9+
import customActionsIOS from '@site/code_blocks/tools/customer-center-custom-actions-ios.swift?raw';
910

1011
## Installation
1112

@@ -97,6 +98,23 @@ import customerCenterEventsModifier from '@site/code_blocks/tools/customer-cente
9798
]}
9899
/>
99100

101+
### Custom Actions
102+
103+
:::info Custom Actions support
104+
The minimum supported version is iOS SDK version 5.34.0.
105+
:::
106+
107+
Custom Actions allow you to add your own custom management options to the Customer Center. When a customer taps on a custom action, your app receives a callback with the custom action identifier, allowing you to execute your own code.
108+
109+
To handle custom actions, use the `.onCustomerCenterCustomActionSelected` modifier:
110+
111+
<RCCodeBlock tabs={[{ type: "swift", content: customActionsIOS, name: "SwiftUI" }]} />
112+
113+
Custom actions are configured in the RevenueCat dashboard under Customer Center settings, where you can:
114+
- Set a custom identifier for the action
115+
- Configure the display text and localization
116+
- Position the action within the management options
117+
100118
## Setup promotional offers
101119

102120
Promotional Offers allow developers to apply custom pricing and trials to new customers and to existing and lapsed subscriptions. Unique promotional offers can be assigned to different paths and survey responses in the Customer Center, but first they must be set up in App Store Connect.

0 commit comments

Comments
 (0)